How to change the color of an Outlook calendar in C #?

I am writing C # code to view / add / edit AppointmentItems in Microsoft Outlook 2007. I am accessing the second calendar (MAPIFolder) and I would like to programmatically change the color of the calendar. Is it possible?

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

Appointments in Outlook are colored, not calendars. Colors are set based on the categories assigned to the appointment, so I think using AppointmentItem.Categories will let you set the color that applies to your appointments.

0
source

Source: https://habr.com/ru/post/1715841/


All Articles