Managing appointments made easy with Microsoft Exchange

Microsoft Exchange is a library that provides an object-oriented model for the communication between applications that interact

Microsoft Exchange is a library that provides an object-oriented model for the communication between applications that interact with a Microsoft Exchange server, saving the developer from having to manually enter the required XML messages to communicate normally.

How to obtain it?

The EWS Managed API is available as an open source project here.

What versions of Microsoft Exchange I can use it with?

  • Office 365
  • Exchange Online
  • Microsoft Exchange Server, from MSE 2007 (SP1) onwards

Use examples

Here are some basic examples of use, to give an overview of what to do with the API.

 Connecting to Exchange

After the instance of the class ExchangeService is configured, the connection is set, but that does not imply it is left open from that point on. When the Exchange query functions are used you miss this object, the connection is made, the requested data is retrieved and it closes automatically so there is no method to close a connection manually.

Check all Appointments from an email box

The following code allows access to the “Calendar” folder associated with a particular email and bring all the appointments of that email in a determined period of time, and for that purpose, the statistics method of ExchangeService is used.findAppointments(FolderId,CalendarView).

Note: We are assuming the getExchangeService ( ) method returns an object of the ExchangeService class, configured as in the above example.

Updating an appointment

To update an appointment, a new object of the “Appointment” class is created and links it to the appointment to be updated by its ItemId and exchange server.When this is done, all the data from the appointment is obtained and it can be to worked with, appropriate modifications are made and the update method ( ConflictResolutionMode ) is invoked for the changes to take effect on the server.

Eliminating an appointment

To eliminate an appointment, just like when upgrading it, it is necessary to know the appointment’s ItemID and have a properly configurated ExchangeService object. After performing the bind, the delete method (DeleteMode) can be invoked. 

Share this articleShare on LinkedInTweet about this on TwitterShare on FacebookShare on Google+Email this to someone
Go Back