There is a way to avoid old calendar events using the service.SyncFolderItems () method.
<SyncFolderItems>
<ItemShape/>
<SyncFolderId/>
<SyncState/>
<Ignore/>
<MaxChangesReturned/> <SyncScope/>
</SyncFolderItems>
This Ignore option will accept a list of event identifiers. and ignore them when synchronizing. To do this, first we need to get the old event identifiers, Exchange will only accept a two-year event
DateTime startDate = DateTime.Now.AddYears(-2); //start from two years earlier
DateTime endDate = DateTime.Now.AddMonths(-1); // End One Month before,
//you can use Convert.ToDateTime("01/01/2013"); what ever date you wanted.
Create a list of product identifiers;
List<ItemId> itmid = new List<ItemId>();
Create a calendar viewer;
CalendarView cView = new CalendarView(startDate, endDate);
Get an appointment,
FindItemsResults<Item> appointments = service.FindItems(WellKnownFolderName.Calendar, cView);
Or you can use this, but the previous code has some optimization. (Google)
FindItemsResults<Appointment> appointments = service.FindAppointments(WellKnownFolderName.Calendar, cView);
Add event IDs to the list,
foreach (var item in appointments)
{
itmid.Add(item.Id);
}
Finally, in your method, SyncFolderItems will look like this:
service.SyncFolderItems(new FolderId(WellKnownFolderName.Calendar), PropertySet.IdOnly, itmid, 10, SyncFolderItemsScope.NormalItems, sSyncState);
Hope this helps any of you.