1
votes

I know how to get the primary email address of the current user, but how can I get a full list of all their SMTP email addresses?

I'm looking for the information you can get when you right-click on a recipient in an email and go to "open outlook properties" and go to the "E-mail Addresses" tab

thanks!

2

2 Answers

2
votes

Read the PR_EMS_AB_PROXY_ADDRESSES MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x800F101F) using Namespace.CurrentUser.AddressEntry.PropertyAccessor.GetProperty.

You can see the addresses in OutlookSpy - click IMAPISession button, click QueryIdentity

1
votes

and for those of you who've never used getProperty, the code looks like this -

Const PR_EMS_AB_PROXY_ADDRESSES  As String = _
"http://schemas.microsoft.com/mapi/proptag/0x800F101F"

Dim NS As Outlook.NameSpace
Set NS = Application.GetNamespace("MAPI")

addresses = _
NS.CurrentUser.AddressEntry.PropertyAccessor.GetProperty(PR_EMS_AB_PROXY_ADDRESSES)