Why EWS Managed API SyncFolderItems does not return recurring appointments

I use the EWS managed API to synchronize my scheduling application with exchange calendars. I get all the normal meetings in order, but I do not have any repeated / repeated meetings.

My code is:

itemChangeCollection = _service.SyncFolderItems( new FolderId(WellKnownFolderName.Calendar, new Mailbox(Email)), propertySet, null, Settings.Default.ExchangeSyncFetchCount, SyncFolderItemsScope.NormalItems, syncState); 

What do I need to change to see recurring appointments?

+4
source share
3 answers

Instances of recurring appointments are not “real” items in the store. They are virtual in the sense that they are calculated whenever you search with a calendar view and a timeframe.

The only way to find recurring appointments is to use the FindItems method.

+3
source

SyncFolderItems returns only the necessary information to restore a repeating series, but does not extend individual entries. If you need extended occurrences, you need to use the FindItems method.

However, even assuming that you can extend the repetition yourself, SyncFolderItems does not provide all the necessary information by itself.

SyncFolderItems will return a list of events with a Single or RecurringMaster AppointmentType. The RecurringMaster event contains the ModifiedOccurrences and DeletedOccurrences . Unfortunately, the elements in ModifiedOccurrences contain only the ItemId, not the element itself. It seems necessary to solve all exceptions separately in order to get the modified entry fields. From the documentation :

Each OccurrenceInfo object in the ModifiedOccurrences collection contains four properties: End , ItemId , OriginalStart, and Start . To access additional properties in an exception element, you must bind to the element using OccurrenceInfo.ItemId .

 foreach (OccurrenceInfo item in recurringMasterItem.ModifiedOccurrences) { Appointment modifiedItem = Appointment.Bind(service, item.ItemId); Console.WriteLine("Subject: " + modifiedItem.Subject); } 

In other words, with the data obtained from SyncFolderItem , you can expand the repetition, including time exceptions and deleted occurrences, but you will have to allow exceptions in other fields (i.e. summary, body, location, etc.) using additional calls .Bind() .

+1
source

SyncFolderItems will provide you with recurring main elements, but it does not extend them to occurrences. The repeating wizard contains common properties for all elements, a repeating pattern, and a list of exceptions and exceptions. This is all the information necessary to expand them. Although you should call Appointment.BindToOccurrence to bind properties for an individual entry from a repeating wizard based on the entry index. The disadvantage of this is the EWS call for each event.

0
source

All Articles