使用C#VSTO创建约会时,您如何找到下一个可用时间

使用C#VSTO创建约会时,您如何找到下一个可用时间,c#,vsto,outlook-addin,C#,Vsto,Outlook Addin,我用C#编写了以下代码,以创建一个有1名与会者(和我)的新约会。但开始时间不会自动默认为下一个可用的空闲时间 AppointmentItem newAppointment = Globals.ThisAddIn.Application.CreateItem(OlItemType.olAppointmentItem); newAppointment.MeetingStatus = OlMeetingStatus.olMeeting; Recipients recipients = newAppo

我用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)和/或约会参与者执行此操作