Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question on getExchangeUser method in Outlook Add-in

75 views
Skip to first unread message

paresh

unread,
Oct 13, 2009, 6:08:02 AM10/13/09
to
Hi,

I have been using below code to get the users detailed contact information.

Dim usersList As Outlook.AddressEntries
Dim oEntry As Outlook.AddressEntry
Dim oContact As Object

Set usersList = Outlook.Application.Session.AddressLists.Item("All
Users").AddressEntries
Set oEntry = usersList.Item("user name")
MsgBox oEntry.GetExchangeUser().BusinessTelephoneNumber & " " &
oEntry.GetExchangeUser().MobileTelephoneNumber

I could see BusinessTelephoneNumber and MobileTelephoneNumber properties in
GetExchangeUser() method but couldn't find HomeMobileNumber. I have verified
the same from Object browser and couldn;t see the HomeTelephoneNumberProperty
there.

Is this expected? How could I get the HomeTelephoneNumber then?

Though I could see the HomeTelephoneNumber property is a part of
ContactItem, I cannot use it as all users won't be part of contacts folder.

Thanks.

Ken Slovak - [MVP - Outlook]

unread,
Oct 13, 2009, 10:14:38 AM10/13/09
to
It's expected since those properties aren't exposed in the Outlook 2007
object model.

If those properties exist at all on the ExchangeUser object you'd have to
use the PropertyAccessor to get at them. In ADUC there is a field for home
number but not for home mobile number, so unless that was added as a custom
property or in a different field I doubt you'd find that one.

Home phone number (PR_HOME_TELEPHONE_NUMBER) should be retrievable using
PropertyAccessor and the DASL tag "urn:schemas:contacts:homePhone", assuming
it exists.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"paresh" <par...@discussions.microsoft.com> wrote in message
news:16A5E21A-6E95-4939...@microsoft.com...

paresh

unread,
Oct 13, 2009, 10:56:01 AM10/13/09
to
Thanks Ken, I got using below query:

Dim oEntry As Outlook.AddressEntry
Set oEntry = usersList.Item(userName)
telNum =
oEntry.GetExchangeUser().PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3A09001E")

Could you tell me what is ADUC?

Also, I have used above proptag schema but I don't know from where it comes.
Is there something similar to object browser for this schema available? So
that I can use it to map between schema and property names like (Home,
Mobile, Business)TelePhoneNymber.

Thanks.
Paresh

Ken Slovak - [MVP - Outlook]

unread,
Oct 13, 2009, 3:05:18 PM10/13/09
to
ADUC = Active Directory Users and Computers, the ultimate source for the
Exchange global address list.

How are you getting and using prop tags without knowing what they are or
where they come from?

I use the Exchange header files and a MAPI viewer called OutlookSpy to get
various property tags and figure out what they are. OutlookSpy displays all
the information needed for that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"paresh" <par...@discussions.microsoft.com> wrote in message

news:991BD65A-4E25-46C6...@microsoft.com...

0 new messages