Reading windows user's email address

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
-
 
Hi Dmitry

Many Thanks

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

Thanks

Regards
 
Back
Top