[E2010][EWS][C#]: Why Appointment.iCalUID does not always match AppointmentItem.GlobalAppointmentId? RRS feed

  • Question

    • Exchange 2010
      Outlook 2010 & 2007
      Visual Studio Tools for the Office system 3.0 Runtime

    I have an Outlook AddIn (created with VSTO) that saves local data associated with an Outlook appointment.   The AppointmentItem.GlobalAppointmentId is being used as the key identifier:

    mainOutlookAppointmentItem = (AppointmentItem)window.CurrentItem;          

    meeting.OutlookID = mainOutlookAppointmentItem.GlobalAppointmentID;

    meeting.OutlookID is:

    Most of the time, this data can be retrieved from Exchange Appointment.iCalUID  by my WebService using the above ID.   

    var calendar = Folder.Bind(service, WellKnownFolderName.Calendar) as CalendarFolder;

    AllAppointments = calendar.FindAppointments(new CalendarView(startDate, endDate));

    var appointment = AllAppointments.Items.FirstOrDefault(a => a.ICalUid == meeting.OutlookId);

    Sometimes the appointment cannot be found in the collection.   Further examination shows that the appointment is in the AllAppointments collection with a different iCalUID:

    These are appointments that are not recurring.  Sometimes that are created by the calendar owner sometimes the appointments are received from other people.

    So why would the iCalUID sometimes NOT match the GlobalAppointmentId? 

    Wednesday, December 14, 2011 9:07 PM