Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need SMTP email address from "EX" type address (Outlook) 2

Status
Not open for further replies.

cfoxhaley

Programmer
Jun 13, 2008
9
US
I currently have an Access 2003 database that analyzes user information stored in several corporate systems. I need to add the capability to compare the e-mail addresses I have in that database to those that are used in specific distribution list in the Global Address List in Outlook 2003(using Exchange Server). I am new to the Outlook Object model, but have managed to access and loop through the distribution list to get most of the information I need. However, the e-mail address I retrieve is in the format:

/o=CMP/ou=Company Name/cn=Recipients/cn=John.Doe

I need it in the format John.Doe@Company.com

In searching this site and others, I have gotten myself thoroughly confused. It seems that this information is not available in the Outlook object model, but that I can get it through CDO, Redemption, or Extended MAPI, using PR_EMS_AB_PROXY_ADDRESSES (&H800F101E).

But how? All of the examples I could find are for deciphering the sender or recipient of a mail message, which I do not have.

What would work great in my process is a simple function that could return the @Company.com address (SMTP:) from the /o=CMP address (Type=EX).

Or, I could also use a separate process that would loop through all of the entries in the Global Address List and allow me to build a separate table containing just the /o=CMP address and the @Company.com address. (This table would probably come in handy later for analyzing other distribution lists).

Can anyone help me? I coding in VBA, and have both the CDO 1.21 Library and Redemption Outlook MAPI COM in my reference list.
 
I noticed a thread that seems like a good way to start to me...

thread705-1544009

It mentions using ADO to execute an LDAP query. Use that and look for an MS Exchange knowledge article on how to find all e-mail addresses on a server. I believe it gives you an LDAP query. There may be quirks and I suspect the OP in the thread I mentioned may be better at working on the LDAP command. You could also search the Exchange forum.

FYI Redemption to my knowledge is good for sending e-mail in an Outlook like object model. It gets around the funny security prompts therefore I don't think it would help. CDO would likely do what you want, but I never got enough of the picture to figure out how it works or how to use it.
 
I'm afraid that didn't help me. I am even less familiar with LDAP than I am with Outlook.
 
Are you aware that you can link an Access database directly into the Exchange GAL ? Click File, Get External Data, in the dialogue box select file type of Outlook() and you should then see the available address catalogs. The Alias column shows the first part of the address, you can base a Select query on the linked GAL table to add the domain portion @whereever.com. Then join the Select query to whatever data you are trying to analyze.
 
What a lifesaver! I took a quick look, and this should solve my problem, without any coding that I don't understand!!!. Thank-you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top