Jump to content

Creating Contacts in New Folder in Outlook


Omatsei
 Share

Recommended Posts

I've got some code that will create a new contacts folder in Outlook, then it will create new contacts... but the contacts only go into the default folder, not the newly created one. Does anybody know how to tell it to put the created contacts into the new folder?

Link to comment
Share on other sites

For anyone in the future, I figured it out (sorta). You have to move them into a folder after they're created.

$objOutlook = ObjCreate( "Outlook.Application" )
$objOLName = $objOutlook.GetNameSpace("MAPI")
$folder = $objOLName.PickFolder

(later in the code after you add someone / something)

$objNewItem.Move( $folder )
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...