Appointment newAppointment = new Appointment(service);
newAppointment.Subject = "Test Subject";
newAppointment.Start = new DateTime(2017, 01, 05, 17, 00, 0);
newAppointment.StartTimeZone = TimeZoneInfo.Local;
newAppointment.EndTimeZone = TimeZoneInfo.Local;
newAppointment.End = newAppointment.Start.AddMinutes(30);
newAppointment.ICalUid = "asdasda=";
newAppointment.Save();
newAppointment.Body = new MessageBody(BodyType.Text, "test");
newAppointment.RequiredAttendees.Add("[email protected]");
newAppointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendOnlyToAll);
ExtendedPropertyDefinition CleanGlobalObjectId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, "ICalUid", MapiPropertyType.String);
PropertySet psPropSet = new PropertySet(BasePropertySet.FirstClassProperties);
psPropSet.Add(CleanGlobalObjectId);
newAppointment.Load(psPropSet);
Folder AtndCalendar = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, "[email protected]"));
SearchFilter sfSearchFilter = new SearchFilter.IsEqualTo(CleanGlobalObjectId, "asdasda=");
ItemView ivItemView = new ItemView(1);
FindItemsResults <Item> fiResults = AtndCalendar.FindItems(sfSearchFilter, ivItemView);
if (fiResults.Items.Count > 0) {
//do whatever
}
这对我无效。我不想使用下面的一段代码,我们遍历日历视图。在很多地方搜索过,并尝试了很多代码片段。EWS托管API,基于ICalUid搜索
EWS没有关于此的文档。任何形式的帮助将不胜感激。
DateTime startDate = new DateTime(2016, 10, 1);
DateTime endDate = new DateTime(2017, 12, 1);
CalendarView calView = new CalendarView(startDate, endDate);