Alternative Property of Recipient.Sendable for Outlook 2007 RRS feed

  • Question

  • Hi,

    I am developing an Outlook Add-In in Outlook 2007 and for a requirement I need the status that the Organizer is in the Recipient list or not. I have Used Recipient.Sendable property in Outlook 2010 addin development and It's work but this property is not work in 2007.

    So, my question is how I can get that the Organizer is in the Recipient list or not in an Outlook Meeting for Office 2007?

    Thanks in an advance,

    Monday, August 11, 2014 11:20 AM


All replies

  • Hello Mahul,

    You are right, the Sendable property was added in Outlook 2010. MSDN states the following:

    This property corresponds to the MAPI property PidTagRecipientFlags.  It returns True if  PidTagRecipientFlags is equal to 0x00000001.

    Setting the property changes PidTagRecipientFlags accordingly. This property applies only to a recipient of a meeting request. If the recipient is not on a meeting request, getting and setting this property does not do anything.

    You can try to use the PropertyAccessor property of the Recipient class to get the value in Outlook 2007. The PropertyAccessor class provides the GetProperty method for this. You just need to get the value for the PidTagRecipientFlags canonical property which corresponds to the the DASL scheme is "".

    The GetProperty method of the PropertyAccessor class has the following description in MSDN:

    The type of the return value will be the same as the type of the underlying property. Certain raw property types such as PT_OBJECT are unsupported and will raise an error. If you require conversion of the raw property type, for example, from PT_BINARY to a string, or from PT_SYSTIME to  a local time, use the helper methods  PropertyAccessor.BinaryToString and PropertyAccessor.UTCToLocalTime.

    As you may see, the PT_BJECT type is not supported. You will need to use a low-level code (Extended MAPI) or any third-party libraries for accessing the value of the PT_OBJECT type.

    Monday, August 11, 2014 12:19 PM
  • Forget about using PropertyAccessor to get this property in Outlook 2007. You cannot get PT_OBJECT properties using PropertyAccessor in any version of Outlook.

    Ken Slovak MVP - Outlook

    Monday, August 11, 2014 2:21 PM
  • it seems you don't read my messages to the end.
    Monday, August 11, 2014 2:22 PM
  • I did. It seems you shouldn't have suggested PropertyAccessor to begin with...

    Ken Slovak MVP - Outlook

    Monday, August 11, 2014 2:29 PM
  • Well, for letting others forum readers know that PropertyAccessor can be used in such cases I described a possible way. But unfortunately it can't be used in the current one. IMHO it is better to say more than less.
    Monday, August 11, 2014 2:42 PM
  • PidTagRecipientFlags is a PT_LONG, not PT_OBJECT property. 0x0E12000D is PR_MESSAGE_RECIPIENTS, which you don't need to access since you already have the MailItem.Recipients collection.

    The DASL property name for PidTagRecipientFlags is, and you can access it using PropertyAccessor just fine.
    Keep in mind however that the property is a bitmap, so you should check that the first bit is set: (value & 1) == 1.

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, August 11, 2014 3:55 PM
  • I guessed how bit flags can be of PT_OBJECT type? ))

    The PidTagRecipientFlags Canonical Property page in MSDN states that it correspond to PR_RECIPIENT_FLAGS (PT_LONG). I mistakengly thought about the PR_MESSAGE_RECIPIENTS which is of PT_OBJECT type.

    So, the PropertyAccessor will help to get the value in Outlook 2007.

    Monday, August 11, 2014 4:16 PM
  • Hi mahul, 

    You can get the organizer address from the following method 

    private Outlook.AddressEntry GetMeetingOrganizer(Outlook.AppointmentItem appt) { if (appt == null) { thrownew ArgumentNullException(); } string PR_SENT_REPRESENTING_ENTRYID = @""; string organizerEntryID = appt.PropertyAccessor.BinaryToString( appt.PropertyAccessor.GetProperty( PR_SENT_REPRESENTING_ENTRYID)); Outlook.AddressEntry organizer = Application.Session. GetAddressEntryFromID(organizerEntryID); if (organizer != null) { return organizer; } else { returnnull; } }

    After you get the name of organizer address now you can check this address is available

    in the recipient list.

    Tuesday, August 12, 2014 2:10 PM