Search code examples
c#icloudoutlook-2007caldav

Unique appointment identifier in outlook when using different computers through sync'd account


Running into a slight annoyance. The application I'm developing has a calendar system built in that feeds appointments to an icloud calendar in outlook for the purpose of synchronising to phones are spread out over multiple icloud calendars (one for each person)

My problem lies in updating these appointments when changes are made on the main application. I know already that I can use AppointmentItem.GlobalAppointmentID to gain the id of the entry placed in the calendar on the computer it was created on, however I'm lead to believe this is only unique for that system (ie, another user on a different computer with the calendar synchronised would have a different set of global ID numbers)

As this number is different for each item, simply storing the GlobalAppointmentID in the database and having the application refer to that when adding/deleting/modifying an appointment wouldn't work as a reference point.

In an ideal world, I'd be using an exchange server to handle all of this, or directly modifying the appointments in icloud using c# (despite my best efforts ive been unable to find a simple method to implement this)

Am I missing something here, or is there no way to identify a unique calendar appointment entry after it has been synchronised?


Solution

  • Your approach is correct. GlobalAppointmentID is the proper way to obtain a global identifier for an Outlook calendar item:

    The Global Object ID is the same across all copies of the item.

    Detailed information on the properties related to that can be found in MS-OXOCAL.

    In the case of the iCloud Control Panel, the GlobalAppointmentID will be derived from the UID iCalendar property. It should also have the raw iCalendar UID available in a separate MAPI property (you can discover such using a tool like OutlookSpy - a tool you should buy if you want to do any serious MAPI development, really).

    Note that you should use the GlobalAppointmentID only for operations which are cross folder. The local identification property is the EntryID, which is like the primary key in a relational database.

    P.S.: This question has some information on building a CalDAV client. Depending on what exactly you want to do, it might not be that hard - it's just an HTTP protocol with a text based payload (iCalendar).