C# – How to change Outlook Calendar Color in C#

ccalendarcolorsoutlook

I'm writing some C# code to view/add/edit AppointmentItems in Microsoft Outlook 2007. I'm accessing a secondary calendar (MAPIFolder), and I would like to programmatically change the color of the calendar. Is that possible?

Best Answer

myNamespace = outLookApp.GetNamespace("MAPI");
if (myNamespace.Categories["liveMeeting"] == null)
{
  myNamespace.Categories.Add("liveMeeting", OlCategoryColor.olCategoryColorDarkRed, OlCategoryShortcutKey.olCategoryShortcutKeyNone);
}
newEvent.Categories = "liveMeeting";