我正在尝试使用带有以下C#代码的Exchange Web服务API在Office 365组(统一组)日历中创建约会(而不是会议)。
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
service.UseDefaultCredentials = false;
service.Credentials = new NetworkCredential("admin@officedomain.com", "pwd");
service.Url = new Uri("https://outlook.office365.com/Ews/Exchange.asmx");
service.PreAuthenticate = false;
Appointment appointment = new Appointment(service);
// Set the properties on the appointment object to create the appointment.
appointment.Subject = "Tennis lesson";
appointment.Body = "Focus on backhand this week.";
appointment.Start = DateTime.Now.AddDays(2);
appointment.End = appointment.Start.AddHours(1);
appointment.Location = "Tennis club";
appointment.ReminderDueBy = DateTime.Now;
Folder rtFolder1 = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, "o365group@officedomain.com"));
appointment.Save(rtFolder1.Id, SendInvitationsMode.SendToNone);
日历事件已成功创建。但我的问题是,它被创建为会议而不是约会。 正如您在上面的代码中看到的那样,我没有添加任何与会者,但是当我在OWA中打开组日历事件时,它会将凭据用户(admin@officedomain.com)显示为与会者,这迫使我不要取消选中“发送邀请”选项到该组“如下图所示。
任何人都可以帮我解决这个问题吗?