我已经使用以下link创建并发送了约会
我的代码:
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("06/01/2012 05:00:00 PM");
appt.Recipients.Add("sanjay.surendra@mycompany.com");
appt.End = Convert.ToDateTime("06/01/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();
Microsoft.Office.Interop.Outlook.MailItem mailItem = appt.ForwardAsVcal();
mailItem.To = "sanjay.surendra@mycompany.com";
mailItem.Send();现在我需要惟一的约会ID,我可以在我的代码中处理它。敬请指教
发布于 2012-06-01 18:48:01
你在找Appointment.EntryID吗?
发布于 2012-06-01 21:30:59
Appointment.EntryID就是你要找的东西。保存或发送(持久化)项后,将分配EntryID属性。
// ...
appt.Save();
string entryID = appt.EntryID;
// ...来自MSDN:
MAPI提供程序在其存储中创建项目时分配唯一的ID字符串。因此,在保存或发送EntryID之前,不会为Outlook项设置__属性。当项目移动到另一个商店时,条目ID会更改...
https://stackoverflow.com/questions/10848767
复制相似问题