none
VSTO - Office Contact Color RRS feed

  • Question

  • Hi,

     

    I'm using the following code for retrieving contacts in Outlook.

    Microsoft.Office.Interop.Outlook.Application olApp = new Microsoft.Office.Interop.Outlook.Application();
                Outlook.NameSpace nameSpace = olApp.GetNamespace("MAPI");
                Outlook.MAPIFolder contacts;
                contacts = nameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
                Outlook.ContactItem itm = (Outlook.ContactItem)contacts.Items.Add(Outlook.OlItemType.olContactItem);


    this all works well with itm.FullName = "blabla"; 

    etc.

     

    However i wish to "color" this contact with a Category, does anyone have any idea how to do that?

    Can't seem to find anything usefull.

     

    Thanks in advance. 

    Wednesday, November 23, 2011 2:22 PM

Answers

  • You can set the ContactItem.Categories property, but that would only add the colored category band to the top of the inspector when the contact is open.
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Wednesday, November 23, 2011 7:55 PM