none
Get contact object from LDAP address entry (Outlook 2013/2016, VSTO) RRS feed

  • Question

  • Hi,

    is there a possibility to get a contact object from a ldap address book in outlook.

    If the user sends an email to a ldap contact (OlAddressEntryUserType.olLdapAddressEntry) I can get the recipient and the address entry in itemsend-event but calling:

    addressEntry.GetContact() or addressEntry.GetExchangeUser() returns null. Is there an equvalent function for ldap to get the contact object?

    Thank you very much



    Regards Mark


    • Edited by Wompi Monday, April 10, 2017 8:00 AM
    Monday, April 10, 2017 7:59 AM

Answers

  • Hello,

    I think Outlook object model doesnt provide any equvalent function to get contact object from LDAP address book. For more information about Address Books, please visit Chapter 7: Address Books and Recipients.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Chenchen LiModerator Friday, April 21, 2017 1:47 AM
    • Marked as answer by Wompi Friday, April 21, 2017 7:09 AM
    Wednesday, April 12, 2017 5:21 AM
    Moderator
  • No, the Outlook object model doesn't provide anything for that.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Proposed as answer by Chenchen LiModerator Friday, April 21, 2017 1:47 AM
    • Marked as answer by Wompi Friday, April 21, 2017 7:09 AM
    Thursday, April 20, 2017 6:36 PM

All replies

  • Hello,

    I think Outlook object model doesnt provide any equvalent function to get contact object from LDAP address book. For more information about Address Books, please visit Chapter 7: Address Books and Recipients.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Chenchen LiModerator Friday, April 21, 2017 1:47 AM
    • Marked as answer by Wompi Friday, April 21, 2017 7:09 AM
    Wednesday, April 12, 2017 5:21 AM
    Moderator
  • No, the Outlook object model doesn't provide anything for that.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Proposed as answer by Chenchen LiModerator Friday, April 21, 2017 1:47 AM
    • Marked as answer by Wompi Friday, April 21, 2017 7:09 AM
    Thursday, April 20, 2017 6:36 PM
  • Hi and sorry for the late response.

    Thank you for your answers.

    Finally I took another way and made a connection to the LDAP "by hand" and looked up the contact.

     var directoryEntry = new DirectoryEntry(_ldapConnectionString);
     DirectorySearcher searcher = new DirectorySearcher(directoryEntry);
     searcher.Filter = ("mail=" + entry.Email);
     var result = searcher.FindOne();

    Best regards

    Mark


    Regards Mark

    Friday, April 21, 2017 7:09 AM