Jump to content
Sign in to follow this  
Omatsei

Creating Contacts in New Folder in Outlook

Recommended Posts

Omatsei

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?

Share this post


Link to post
Share on other sites
Omatsei

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 )

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.