Reputation: 65
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!
Upvotes: 1
Views: 1112
Reputation: 66276
Read the PR_EMS_AB_PROXY_ADDRESSES
MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x800F101F
) using Namespace.CurrentUser.AddressEntry.PropertyAccessor.GetProperty
.
Each address will be prefixed with the address type (e.g. "EX:" or "smtp:"). The default SMTP address will be prefixed with "SMTP:" (all capitals).
You can see the property in OutlookSpy (I am its author) - click IMAPISession button, then QueryIdentity
Upvotes: 0
Reputation: 65
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)
Upvotes: 1