0
votes

I am working on an Add-in and as part of my work, I need to be able to Accept a meeting request. I need to be able to do this from both the Mail tab when a MeetingItem is selected in the Inbox, and from the Calendar tab when an AppointmentItem is selected.

For a given MeetingItem, I can use the built-in .GetAssociatedAppointment() to get the corresponding appointment. Then it's easy to do a .Respond() on the appointmentItem and a .Send() on the meetingItem.

However, is there an efficient way to work backwards, when I am in the calendar view and I have only the selected AppointmentItem? I need to be able to find that original MeetingItem in the Inbox, if it is still there (user could have deleted it and the appointment item is still visible on the Calendar). I believe I can iterate through all of the Items in the Inbox and for each MeetingItem, get the associated appointment item and see if its GlobalAppointmentID equals the GlobalAppointmentID of the appointmentItem that is selected in the calendar--if so, that's the original MeetingItem.

Is there a better way to do this? I am aware of .Filter() and .Find() on the the Inbox Items collection but seeing as how I need to first get the associated appointment item in order to see if the meeting item is the one that corresponds to my appointmentItem over in the calendar, I don't think I can do this with a filter (passed to .Filter() or .Find()).

It just seems like there would be a relatively easy way to get the original meetingItem for a given appointmentItem.

Any help?

1

1 Answers

1
votes

Searching by the appointment id is the only way. There is no other way since there is no one-to-one correspondence between an appointment and (potentially) multiple meeting items in the Inbox and Sent Items folder.

Also keep in mind that Outlook Object Model will not let you search for binary (PT_BINARY) properties such as GlobalAppointmentID or CleanGlobalObjectId. You would need to use Extended MAPI (C++ or Delphi) or Redemption (any language) for that.