Updates MS Outlook’s Calendar entries with appointments from the Scheduler storage.
NuGet Package: DevExpress.Win.Scheduler
public void SynchronizeOutlookWithStorage( string outlookEntryIdFieldName )
Public Sub SynchronizeOutlookWithStorage( outlookEntryIdFieldName As String )
A String that is the name of the data field which contains the Outlook Entry ID value.
The SynchronizeOutlookWithStorage method synchronizes the contents of MS Outlook’s Calendar with data from the storage. After synchronization, MS Outlook’s Calendar will contain a copy of the storage’s appointments. If a specific appointment in the Calendar does not match an appointment in the storage, it will be deleted.
Every appointment in MS Outlook’s Calendar has a unique identifier. To allow data to be synchronized between the storage and MS Outlook’s Calendar, add a string field to the database which stores appointments for the scheduler control. This field will contain Outlook entry IDs, and it will be automatically populated during synchronization. The method’s outlookEntryFieldName parameter specifies the name of this field.
WARNING: If you call the
SchedulerDataStorage.SynchronizeOutlookWithStorage method, all data in your MS Outlook will be lost. We suggest that you backup all your data prior to running this example.
Before synchronizing the SchedulerDataStorage with MS Outlook, create an additional field in your database. This field should be of the string type with a length of at least 50 characters, and intended to store the Outlook Entry Id for each appointment that is to be synchronized. Assuming the field is called “OutlookEntryId”, you can then use the following code to synchronize the Scheduler Storage with MS Outlook and vice versa.
For this example to work correctly, the Scheduler’s data source should provide a field to store the Outlook Entry ID. The filed should be mapped to a custom appointment field, as illustrated below.
schedulerDataStorage.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("OutlookId", "OutlookEntryId"));
If your task is to combine all data from the SchedulerDataStorage and MS Outlook, use the SchedulerDataStorage.ExportToOutlook and SchedulerDataStorage.ImportFromOutlook methods instead. To set custom rules when synchronizing appointments, use the AppointmentExportSynchronizer and the AppointmentImportSynchronizer classes.