我希望在用户日历中插入约会,我可以使用 Microsoft.Office.Interop.Outlook.Application (如下)轻松插入自己的约会,然后将用户添加为收件人,但如果我不想添加自己怎么办,如果我只想添加其他人?这可以以类似的方式完成吗?
谢谢
Microsoft.Office.Interop.Outlook.Application app = null;
Microsoft.Office.Interop.Outlook.AppointmentItem appt = null;
app = new Microsoft.Office.Interop.Outlook.Application();
appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
appt.Subject = "Meeting ";
appt.Body = "Test";
appt.Location = "a room";
appt.Start = Convert.ToDateTime("08/08/2012 05:00:00 PM");
appt.Recipients.Add("a@b.com");
appt.End = Convert.ToDateTime("08/08/2012 6:00:00 PM");
appt.ReminderSet = true;
appt.ReminderMinutesBeforeStart = 15;
appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
appt.Save();