Question

ChristianHavelDE on Tue, 26 Jan 2016 13:39:52


Hi,

I can create a new contact in the Contacts with the following code.

How can I create a new Contact in a specific PublicFolder using its StoreId?

Application olApp = null;
_ContactItem olContactItem = null;

try
{
olApp = new Application();
olContactItem = (_ContactItem)olApp.CreateItem(OlItemType.olContactItem);
olContactItem.BusinessTelephoneNumber = "123";

olContactItem.Save();
olContactItem.Display(true);
Thanks
Christian



Sponsored



Replies

Eugene Astafiev on Tue, 26 Jan 2016 14:51:11


Hello Christian,

See How To: Create a new Outlook Contact item programmatically for all possible ways of creating contact items.

You may try to use the Move method of the ContactItem class which allows to move a Microsoft Outlook item to a new folder. Or may get a target folder and use its Items property by calling the Add method.

ChristianHavelDE on Tue, 26 Jan 2016 15:26:23


Hi Eugene,

thanks for yours help. I used the Items.Add method.

Regards

Christian