I am using the Office.NET platform to create appointments in Outlook. The code that creates the meetings is as follows:
private void createCalendarEvent(DateTime start, DateTime end, String dept, String subj, String subjType, String room)
{
AppointmentItem apt = (AppointmentItem)OLapp.CreateItem(OlItemType.olAppointmentItem);
apt.Start = start;
apt.End = end;
apt.Subject = subj + " - " + subjType;
apt.Body = "Subject: " + subj + " (" + subjType + ")"
+ "\nDepartment: " + dept
+ "\nRoom: " + room
+ "\n\nCreated by " + this.Text
+ "\n On " + DateTime.Now.ToLongDateString() + " At " + DateTime.Now.ToLongTimeString();
apt.Location = room;
apt.Categories = subj;
apt.Save();
}
This works fine, but the category I am setting does not have a color associated with it. I want meetings in Outlook to look different depending on the set of categories. Is there a way that I can manually set the colors of categories? Or is it even better to get a framework for automatically selecting category colors for me?
Thomi source
share