none
How to get the organizer of a meeting in C# RRS feed

  • Question

  • Hi,

    On creation of new meeting, I am trying to get the (display name and email address of) organizer of the meeting, but as the meeting is not saved/sent, I am getting null value.

    I have tried using "AppointmentItem.Organizer" property, as well as the schema "http://schemas.microsoft.com/mapi/proptag/0x0042001E" , both returns null value for new meeting request.

    Can anyone help me out to get the correct value for the same.

    Correct value implies that it should provide the actual Organizer instead of the current user (specially while creating a meeting in shared calendar)

    Thanks !


    Tuesday, September 27, 2016 2:03 PM

Answers

  • If you can extract the EX address from the store entry id, you can construct the GAL entry id and pass it to MNamespace.getAddressEntryfromId, then use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

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

    • Marked as answer by Pratik Prakash Wednesday, October 5, 2016 3:47 PM
    Thursday, September 29, 2016 3:26 PM

All replies

  • Hello Pratik,

    Try to use any low-level property viewer such as MFCMAPI or OutlookSpy. What values do they show?

    Typically you need to call the Save method before accessing the Outlook item which has changes made in the UI. It is a known issue when dealing with OOM.

    P.S. You may find the How to: Get the Organizer of a Meeting article helpful.


    [custom.development]

    Tuesday, September 27, 2016 2:29 PM
  • Hi Eugene,

    Earlier, I tried using OutlookSpy to find related property, but there was nothing specific to organizer.

    So, i tried "0x0042001E = PR_SENT_REPRESENTING_NAME", but this gave null as meeting is not saved.

    The Other property I tried is "PR_STORE_ENTRYID = 0x0FFB0102" which gives me a byte array, and on converting it to string provides me the email (organizer's) address in Exchange format.

    But, I am not sure how to get SMTP address out of it (i.e. how should I convert the MailboxDN to smtp address).

    I also tried using the way mentioned in article, but the schema "http://schemas.microsoft.com/mapi/proptag/0x00410102" itself threw an exception saying that property not found.


    Tuesday, September 27, 2016 3:02 PM
  • Hello Pratik,

    Did you have a chance to check the EntryID property value? Is it empty?


    [custom.development]

    Tuesday, September 27, 2016 7:20 PM
  • If this is a new appointment, would the organizer be the store owner (in case of Exchange) or Namespace.CurrentUser?

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

    Wednesday, September 28, 2016 10:27 PM
  • Hi Dmitry,

    Current User may not return the correct value for (actual) organizer, when the meeting is not saved or when the meeting is being created from a shared calendar.

    Thursday, September 29, 2016 9:23 AM
  • Then you need to figure out the store owner. There is no straightforward way to do that in OOM, but if Redemption is an option, it exposes the RDOExchangeMailboxStore.Owner property. RDOExchangeMailboxStore can be retrieved RDOSession.GetRDOObjectFromOutlookObject if you pass the original Store object as the parameter.

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

    Thursday, September 29, 2016 1:35 PM
  • Hi Eugene,

    Yes, I tried to fetch the EntryID property value "PR_ENTRYID = 0x0FFF0102", but it throws "property not found exception.

    I guess, using "PR_STORE_ENTRYID = 0x0FFB0102" to get the store owner meets my requirement, but the only issue is, it gives me address in exchange format.

    So, if there is a way to  convert the MailboxDN to smtp address using OOM, it would solve the purpose.

    Thursday, September 29, 2016 3:04 PM
  • Yes Dmitry, 

    I can fetch the store owner by passing "PR_STORE_ENTRYID = 0x0FFB0102" to PropertyAccessor object of meeting, which gives me the address in Exchange (MailboxDN) Format.

    I am not sure how to convert it to SMTP format.

    Maybe I will have to use Extended MAPI for the same.

    Thursday, September 29, 2016 3:10 PM
  • If you can extract the EX address from the store entry id, you can construct the GAL entry id and pass it to MNamespace.getAddressEntryfromId, then use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

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

    • Marked as answer by Pratik Prakash Wednesday, October 5, 2016 3:47 PM
    Thursday, September 29, 2016 3:26 PM
  • yeah, but for 2007 version, somehow it doesn't work.

    For 2010 version on wards, I am able to get the smtp address.

    Wednesday, October 5, 2016 3:35 PM