Manage Exchange Web Services, Receive Remote Meetings

I am going to write an ews application to connect sharing with another calendar program. What happened to me, how do I know which appointments are deleted during the exchange? Is there any way to tell? I could not find it in the API and documentation.

Thanks in advance.

+7
source share
2 answers

Depending on how the user deletes the meeting (or any item), different actions are performed:

  • Soft-Delete: the item is moved to the mailbox trash.
  • Hard-Delete: The item is deleted immediately.

You have several ways to get information about deleted items:

  • Request a folder by calling FindItems and select ItemTraversal.Associated in the Traversal property of ItemView. Note. This requires Exchange 2010.
  • Use SyncFolderItems at a time and store the sync cookie somewhere. Later, run SyncFolderItems again using the previously saved cookie. Exchange will now provide you with a detailed list of changes that have occurred to this folder.
  • Request basket for appointments. Most likely, they will appear in the user's default calendar.
+6
source

I wrote a service that synchronizes EWS calendar appointments in an Sql table.

To delete after inserting / updating changes, if there is a row in the database, and not in EWS, I will delete it, as this means that it was deleted in Exchange. I use a GUID to track destination in a database and share. Web Services Exchange: Why is ItemId Not a Constant? [Continued]

Decent performance with dozens of assignments, I'll try it on a much larger dataset.

Dim appointmentGuid As New List(Of String) For Each appointment In appointments 'appointments is IEnumerable(Of Appointment) from EWS Dim guid As String = GetGuidForAppointment(appointment) If String.IsNullOrEmpty(guid) Then SetGuidForAppointment(appointment) guid = GetGuidForAppointment(appointment) End If appointmentGuid.Add(guid) 'Upsert rows ... Next 'Delete orphaned rows Using sqlConnection As New SqlConnection(ConnectionString) Dim deleteScript As New StringBuilder() Using sqlCmd As New SqlCommand("SELECT ID FROM Appointments", sqlConnection) Using sqlDataReader As SqlDataReader = sqlCmd.ExecuteReader() sqlConnection.Open() While sqlDataReader.Read() Dim guid As String = sqlDataReader.GetString(0) If Not appointmentGuid.Contains(guid) Then deleteScript.AppendFormat("DELETE FROM Appointments WHERE ID = '{0}'; ", guid) End If End While End Using End Using If deleteScript.Length > 0 Then Using sqlCmd As New SqlCommand(deleteScript.ToString(), sqlConnection) sqlCmd.ExecuteNonQuery() End Using End If End Using 
0
source

All Articles