none
pr_entryid is not unique for recipients RRS feed

  • Question

  • Hi,

    If I create two meetings both having the same invitee's email address, both Recipient objects in their respective AppointmentItem objects get the same PR_ENTRYID! At the same time, their instance keys are different. However, I have to reference items by their PR_ENTRYID as this seems to be the only way to pass ids between COM automation and MAPI (COM does not provide instance key to MAPI).

    How can I overcome this? I'm using Outlook 2010 32-bit.

    PR_ENTRYIDs of two Recipient items:

    00000000FE42AA0A18C71A10E8850B651C24000003000000040000000000000018000000000000001E7FDF4152B0E944BA66DFBF2C6A6416E4F52000487F22
    00000000FE42AA0A18C71A10E8850B651C24000003000000040000000000000018000000000000001E7FDF4152B0E944BA66DFBF2C6A6416E4F52000487F22

    Instance keys:
    0000D79F
    0000D7B0

    Regards,
    Alex

    Thursday, July 19, 2012 8:38 PM

Answers

All replies

  • Why do you expect the recipient entry ids to be different? It is the same recipient (name/address/address type), hence the entry id is the same.

    What exactly are you trying to do and why?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, July 19, 2012 11:51 PM
  • Thank you for reply. For instance, different recipients (being the same person) can have different meeting response status for different meetings. I would like to update meeting response status for a particular recipient in a particular event. Nevertheless, Outlook makes a difference between two recipients assigning different instance keys to them so that internally they don't seem to be the same object.

    Friday, July 20, 2012 11:51 AM
  • No, think of a recipient entry id as a link to an external object - e.g. there is only one "Joe The User" GAL entry, but multiple items can point to it. The meeting response is unique in the context of a particular appointment only, i.e. the combination of the appointment entry id and the recipient entry id is unique, not the recipient entry id alone.

    PR_INSTANCE_KEY (http://msdn.microsoft.com/en-us/library/cc765693.aspx) is a property that uniquely identifies a row in a MAPI table (any MAPI table, such the recipient table, attachment table, folder contents table, etc.). It is unique in the context of that MAPI table only; in general, you cannot compare PR_INSTANCE_KEY from different tables, and the value of PR_INSTANCE_KEY can change next time you open the table.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Friday, July 20, 2012 1:52 PM
  • Thanks again. Still, how can I uniquely identify a particular meeting request? I'm given Outlook::Recipient object for which I need to set meeting request status.

    CComPtr<Outlook::Recipient> spRecipient;
    hr = spRecipients->Item(CComVariant(i), &spRecipient);
    
    Outlook::OlResponseStatus responseStatus = Outlook::OlResponseStatus::olResponseNone;
    
    spRecipient->get_MeetingResponseStatus(&responseStatus);
    
    CComBSTR bsEntryID;
    spRecipient->get_EntryID(&bsEntryID);

    I then convert EntryID with FBinFromHex function to locate that recipient object in MAPI.

    However, further findings show that I cannot change MeetingResponseStatus for a particular Recipient object anyway. Looks like I have to save AppointmentItem first and then update the recipient table with ModifyRecipients method. Even if EntryID were unique, it does not help as it does not get generated until I save the AppointmentItem. Moreover, even if I had to change only existing recipients which already have EntryID, ModifyRecipients method cannot accept Recipient object (so that it would not help me to locate Recipient object by its EntryID as I can't then pass that object to ModifyRecipients).

    Seems the only way is to update AppoinmentItem with Recipient objects, save it, and then iterate through it again, changing MeetingResponseStatus via ModifyRecipients.

    Monday, July 23, 2012 11:31 AM
  • >Still, how can I uniquely identify a particular meeting request? I'm given Outlook::Recipient object for which I need to set meeting request status.

    Why would you think that information from a recipient would be useful to locate a particular meeting request? Is it not possible for the same recipient to be present on several different meeting requests?

    If you want to uniquely identify a particular meeting request, you need to get information from the meeting request itself, not the recipients.

    It's unclear what your overal goal here is. What are you looking to accomplish?

    Monday, July 23, 2012 4:30 PM
    Answerer
  • Thank for the reply. I'll explain my case in more detail. I'm writing a CalDAV sync tool for Outlook. It has to sync events in Outlook with CalDAV server (including events with attendees). Everything works via Outlook object model. For every event, I can copy all the data except of meeting request statuses (Recipient.MeetingResponseStatus is a read-only property in Outlook object model). I can set it via Redemption but it's not an option to use the closed source library in my project. If I don't bother of meeting request statuses at all, Outlook offers me to send invitations to persons which have already received them by other means (via other CalDAV clients).

    Since it's not possible to set Recipient.MeetingResponseStatus by other means I have to use Ext. MAPI for this. As I initially have AppointmentItem object with Recipients collection I constructed, I wanted to somehow match every Recipient object with its Ext.MAPI version (row in recipients table) and apply the fix with Ext.MAPI functions.

    Does it sound clear now?

    Monday, July 23, 2012 5:07 PM
  • You will need to modify the recipient status in the message recipient table.

    Grab the existing recipient(s) using IMessage::GetRecipientTable HrQueryAllRows/IMAPITable::QueryRows, adjust the data appropriately, set the changes back using IMessage::ModifyRecipients().


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Monday, July 23, 2012 5:47 PM
  • This is exactly what I'm doing right now. So I'm on the right route. Thanks again!
    Monday, July 23, 2012 6:04 PM
  • One more question, though. I successfully change meeting response status with 0x5FFF0003 property. However, it only works if outlook invitations have already been sent for the meeting. If they haven't, Outlook still  prompts me to send them out. Perhaps, there should be another property "invitations have been sent for event" (for recipient or for entire event). Could you please let me know its name, id, or anything which can help? Thanks!
    Wednesday, August 1, 2012 3:12 PM
  • Check the FInvited named property ({00062002-0000-0000-C000-000000000046}, 0x8229, PT_BOOLEAN) - set it to true.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, August 2, 2012 3:41 AM
  • Thanks again, it's working perfectly!
    Thursday, August 2, 2012 11:58 AM