I finally got an iPhone, and will be syncing it to my company's Exchange environment. I used to sync my WinMo phone with my personal world. I wanted to start adding contact pictures so they would show up on my phone. One by one was easy, but there are a few things where I wanted to add the same picture to a bunch of contacts. Turns out that's easy too, with a little programming.
Microsoft.Office.Interop.Outlook._Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();
NameSpace outlookNamespace = outlookApp.GetNamespace("MAPI");
MAPIFolder contactsFolder = outlookNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
foreach (ContactItem contact in contactsFolder.Items)
{
if (contact.Categories.ToString().Contains("something"))
{
contact.AddPicture("C:\\Users\\username\\Pictures\\Contact Images\\image.gif");
contact.Save();
contact.Close(OlInspectorClose.olSave);
}
}