Reading windows user's email address

J

John

Hi

Outlook 2003 connected with exchange server.

A user is logged in to the client pc. Is it possible to programmatically get
the user's email address that is set on the 'Email Addresses' tab of the
exchange server?

Thanks

Regards
 
D

Dmitry Streblechenko

If you are using VB.Net, Extended MAPI is not an option, so you are left
either with AD (read the proxyAddresses AD attribute) or CDO 1.21 or
Redemption.
In Redemption the following script will do the job (assuming Application
points ot an instance of the Outlook.Application object):

PR_EMS_AB_PROXY_ADDRESSES = &H800F101E
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set addressEntry = session.CurrentUser
ProxyAddresses = addressEntry.Fields(PR_EMS_AB_PROXY_ADDRESSES)
For i = LBound(ProxyAddresses) To UBound(ProxyAddresses)
Debug.Print(ProxyAddresses(i))
Next
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
J

John

Hi Dmitry

Many Thanks

Would appreciate if I can have a CDO 1.21 example too.

Thanks

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top