使用 C# VSTO 创建约会时如何找到下一个可用时间
How do you find the next available time when creating an Appointment using C# VSTO
我用 C# 编写了以下代码来创建与 1 位与会者(和我)的新约会。但开始时间不会自动默认为下一个可用空闲时间。
AppointmentItem newAppointment = Globals.ThisAddIn.Application.CreateItem(OlItemType.olAppointmentItem);
newAppointment.MeetingStatus = OlMeetingStatus.olMeeting;
Recipients recipients = newAppointment.Recipients;
Recipient readyByRecipient = null;
readyByRecipient = recipients.Add(emailAddress);
readyByRecipient.Type = (int)OlMeetingRecipientType.olRequired;
recipients.ResolveAll();
newAppointment.Display();
Marshal.ReleaseComObject(readyByRecipient);
Marshal.ReleaseComObject(recipients);
Marshal.ReleaseComObject(newAppointment);
有人可以告诉我如何将约会开始时间默认为所有与会者的下一个空闲时间吗?
或者如何以编程方式确定下一个可用空闲时间是所有与会者的时间?
使用Recipient.FreeBusy(或AddressEntry.GetFreebusy)查看可用的时间段。您可以为当前用户 (Application.Session.CurrentUser) and/or 约会参与者执行此操作。
我用 C# 编写了以下代码来创建与 1 位与会者(和我)的新约会。但开始时间不会自动默认为下一个可用空闲时间。
AppointmentItem newAppointment = Globals.ThisAddIn.Application.CreateItem(OlItemType.olAppointmentItem);
newAppointment.MeetingStatus = OlMeetingStatus.olMeeting;
Recipients recipients = newAppointment.Recipients;
Recipient readyByRecipient = null;
readyByRecipient = recipients.Add(emailAddress);
readyByRecipient.Type = (int)OlMeetingRecipientType.olRequired;
recipients.ResolveAll();
newAppointment.Display();
Marshal.ReleaseComObject(readyByRecipient);
Marshal.ReleaseComObject(recipients);
Marshal.ReleaseComObject(newAppointment);
有人可以告诉我如何将约会开始时间默认为所有与会者的下一个空闲时间吗?
或者如何以编程方式确定下一个可用空闲时间是所有与会者的时间?
使用Recipient.FreeBusy(或AddressEntry.GetFreebusy)查看可用的时间段。您可以为当前用户 (Application.Session.CurrentUser) and/or 约会参与者执行此操作。