EWS Managed API How to get calendar items in a recurring series programmatically

Exchange Web Service
Exchange-Web-Service

This sample shows you how to use the Exchange Web Services EWS Managed API to get calendar items in a recurring series programmatically.

A recurring series of appointments or meetings is made up of a recurring master, a number of occurrences in a series that repeat according to a set pattern, and, optionally, sets of occurrences that were changed and that were deleted.

How it works:

The following table summarizes the different methods to retrieve Appointment items from an Exchange calendar

If you have the item ID for… You can get… By using the…
The recurring master calendar item the first Occurence in the series Appointment.FirstOccurrence
the last Occurence in the serie Appointment.LastOccurrence property
The exceptions to the serie Appointment.ModifiedOccurrences property
The deleted appointments of the serie Appointment.DeletedOccurrences property
Any occurrence (given its index) Appointment.BindToOccurrence method
A single occurrence in a series The recurring master Appointment.BindToRecurringMaster method
Any calendar item (an Appointment object) The appointment type enumeration value Appointment.AppointmentType property

Sample method:

The following method GetRecurringSeriesItems accepts an instance of the ExchangeService class to connect to the Exchange Web Service.

In this method we find all the appointments in the calendar based on the dates set in the CalendarView. This will return the occurrences and exceptions to a recurring series and will return appointments that are not part of a recurring series. This will not return recurring master items.
Note that a search restriction or querystring cannot be used with a CalendarView.

To start using EWS Managed API, see this article: http://dotnet-practice.com/utiliser-exchange-web-service-ews-managed-api/

Be the first to comment

Leave a Reply

Your email address will not be published.


*