none
VSTO Exchange User RRS feed

  • Question

  • Hello everyone,

    I need to recover HomeTelephoneNumber, Home2TelephoneNumber and Work2TelephoneNumber with a ExchangeUser as I made with a ContactItem. I see that Outlook recover these one in the contact card but I don't find any methods to do that with ExchangeUser. How can I recover them ?

    Thanks for your answers.

    Monday, February 8, 2016 12:29 PM

All replies

  • Hello,

    What did you do with an Exchange user for recovering properties?

    You may find the How to: Get Information About the Current User article helpful.

    Monday, February 8, 2016 3:37 PM
  • Retrieve the PR_HOME_TELEPHONE_NUMBER MAPI property using AddressEntry.PropertyAccessor.GetProperty.

    PR_HOME_TELEPHONE_NUMBER DASL property name is  http://schemas.microsoft.com/mapi/proptag/0x3A09001F

    Take a look at the current user in OutlookSpy to see other available property properties and their DASL names (click IMAPISession, QueryIdentity)..


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

    Monday, February 8, 2016 4:12 PM
  • public Contact(Microsoft.Office.Interop.Outlook.ExchangeUser c)
    {
                this.subject = c.Name;
                this.work = c.BusinessTelephoneNumber;
                this.home = c.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3A09001F");
                this.mobile = c.MobileTelephoneNumber;

    }

    I try this but I have this exception A first chance exception of type 'System.Runtime.InteropServices.COMException'

    with the call of my contructor:

    AddressEntry addrEntry = rec.AddressEntry;

    contact = new Contact(addrEntry.GetExchangeUser());

    Tuesday, February 9, 2016 8:35 AM
  • Which line raises the exception? What is the exact exception message and the error code? Keep in mind that if the property does not exist on that particular GAL entry, GetProperty will raise an exception - this is normal and must be handled by your code

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

    Tuesday, February 9, 2016 12:56 PM
  • this.home = c.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3A09001F");

    This line raises the exception. So does it mean that i can't recover the home number of my ExchangeUser ?



    • Edited by Akator64 Tuesday, February 9, 2016 1:32 PM
    Tuesday, February 9, 2016 1:30 PM
  • Do you see that property for that particular GAL user in OutlookSpy?

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

    Tuesday, February 9, 2016 1:34 PM
  • I work on a work pc and I can't install Outlook because I am not administrator. So I dont't know :s

    Tuesday, February 9, 2016 1:36 PM
  • OutlookSpy can be installed without local admin rights.

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

    Tuesday, February 9, 2016 1:58 PM
  • The installer ask me the network rights that I haven't got.
    Tuesday, February 9, 2016 2:07 PM
  • Download the zip file from http://www.dimastr.com/outspy/download/OutlookSpy.zip , copy the appropriate dll to any folder, register it with regsvr32.exe.

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


    Tuesday, February 9, 2016 2:10 PM
  • Dead link :s

    Tuesday, February 9, 2016 2:19 PM
  • Comma was part of the url. Try it again.

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

    Tuesday, February 9, 2016 2:59 PM
  • Hi Akator64,

    >> see that Outlook recover these one in the contact card but I don't find any methods to do that with ExchangeUser.

    What do you mean with ExchangeUser? Have you store ExchangeUser in your Contact? If you have, for you ContactItem, I think you could use HomeTelephoneNumber and Home2TelephoneNumber properties of ContactItem.

    Or, do you mean you want to get the TelephoneNumber from User in Exchange? If so, how do you check them in your outlook contact? As my test, it seems the PhoneNumer in Outlook is related with Outlook contact instead of Exchange User PhoneNumber.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Tuesday, February 16, 2016 5:41 AM
  • Hi Dmitry,

    >> Retrieve the PR_HOME_TELEPHONE_NUMBER MAPI property using AddressEntry.PropertyAccessor.GetProperty

    I used OutlookSpy to get PR_HOME_TELEPHONE_NUMBER, it return the value of my ContactItem Telephone. But if I use AddressEntry.PropertyAccessor.GetProperty, it will return error “the property " http://schemas.microsoft.com/mapi/proptag/0x3A09001F" is unknown or can not be found”. It seems PR_HOME_TELEPHONE_NUMBER is not the property of AddressEntry.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, February 16, 2016 6:35 AM
  • I am not sure I understand - do you mean you can see the PR_HOME_TELEPHONE_NUMBER property on the IMessage object representing the contact item, but it is not present on the IMailUser object that is based on that contact?

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

    Tuesday, February 16, 2016 4:41 PM
  • Hi Dmitry,

    I mean I could get PR_HOME_TELEPHONE_NUMBER value when I navigate to People tab with OutlookSpy. But if I use AddressEntry.PropertyAccessor.GetProperty with http://schemas.microsoft.com/mapi/proptag/0x3A09001F. it return error.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, February 17, 2016 7:09 AM
  • Have you tried AddressEntry.GetContact()?

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

    Wednesday, February 17, 2016 12:40 PM