none
[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:
    040000008200E00074C5B7101A82E00800000000000000000000000000000000000000004D0000007643616C2D556964010000003546303934324135443846443437334542343736444446454339323942373632303030303030303030303030303030303030303030303030303030303030303000.

    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:
    5F0942A5D8FD473EB476DDFEC929B76200000000000000000000000000000000

    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