Hi guys,
I have a problem
I need to make an appointment with some bold text in it.
I also want to set a category for it (color)...
I heared that it is possible to implict RTF into appointment.body - but I dunno how to do that...
My code is:
// Create a OOM reference
Outlook.Application outApp = new Microsoft.Office.Interop.Outlook.Application();
// Acquire the namespace
Outlook.NameSpace ns = outApp.GetNamespace("MAPI");
// Create a receipient object that is going to be the organizer of the meeting
Outlook.Recipient myOrganizer =
ns.CreateRecipient(calendar); //"PMI, IS European Help Desk - Poland"
myOrganizer.Resolve();
// Open the shared calendar for this receipient
Outlook.MAPIFolder sharedCalendar = ns.GetSharedDefaultFolder(myOrganizer, Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar);
Outlook._AppointmentItem myAppointment = (Outlook._AppointmentItem)sharedCalendar.Items.Add(Outlook.OlItemType.olAppointmentItem);
// Setup the requirements for the appointment
myAppointment.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
DateTime date1 = dateTimePicker1.Value.Date + TimePicker1.Value.TimeOfDay;
DateTime date2 = dateTimePicker1.Value.Date + TimePicker2.Value.TimeOfDay;
myAppointment.Start = Convert.ToDateTime(date1); // Set the start date
myAppointment.End = Convert.ToDateTime(date2);
myAppointment.Subject = SUBJECT_APPOINTMENT();
myAppointment.Body = ">>>I NEED IT BOLD<<<SYSTEMS: " + SystemBox.Text + Environment.NewLine;
myAppointment.Body += ">>>I NEED IT BOLD<<<DESCRIPTION: " + Environment.NewLine + EngBox.Text;
myAppointment.Importance = Outlook.OlImportance.olImportanceHigh;
// Save the appointment in the shared calendar
myAppointment.Save();
// Send out the invites
myAppointment.Send();
AddMessage("\r\nAPPOINTMENT CREATED: ", Color.Green, FontStyle.Regular);
AddMessage(calendar, Color.Black, FontStyle.Regular);
THX for help!