Tôi đang cố gắng tạo một cuộc hẹn trong lịch Microsoft Outlook (2003) của người khác bằng cách sử dụng mã bên dưới. Khi chạy chương trình này, Cuộc hẹn sẽ được lưu trong lịch của tôi.But không được gửi đến người nhận.Làm cách nào để tạo và gửi các cuộc hẹn đến lịch Microsoft Outlook?
try
{
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 Appointment body";
appt.Location = "TBD";
appt.Start = Convert.ToDateTime("12/23/2009 05:00:00 PM");
appt.Recipients.Add("[email protected]");
appt.End = Convert.ToDateTime("12/23/2009 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();
appt.Send();
}
catch (COMException ex)
{
Response.Write(ex.ToString());
}
Tôi có thiếu gì không? Bất kỳ ai có thể giúp tôi để giải quyết vấn đề này?