PDA

View Full Version : **Need a Guru help** Resolving ID's to their email address in outlook



CodyOebel
08-17-2012, 09:28 AM
Ok, let me give you an example of what I am trying to do.
Within my corporation, we all have ID's, when you put that ID in a To: field, it displays that persons name, and not their actual internal email address.

If I paste a list of ID's in the BODY of the email, and you right click on that ID, and click on WhoIs it displays the properties of that ID. I'm trying to get the SMTP info for that ID e.g If your corporate ID\Domain user name was Guru1 if I put Guru1 in an emails to field it may list John.Doe@Domain.com What I am trying to get is the John.Doe@Domain.com, but for a list of users.

So in the body of the email for example say I have a list of five users.

Guru1
Guru2
Guru3
Guru4
Guru5

I want the email address to each of them. I cant find a basic option in outlook that resolves their ID to their email in the to field. It is irritating there is not such a simple option to simply display their email, instead outlook in the To field, displays their name in lastname,first name format. Ide rather it be last.first@domain.com

Any help would be appreciated.

JP2112
08-29-2012, 12:42 PM
If anything, I'm sure that's an Exchange setting (showing the display name instead of the email address).

What do you see when you run this code?


Sub getem()
MsgBox GetEmailAddress("Guru1")
End Sub
Function GetEmailAddress(idnum As String)
Dim username As String
username = session.CreateRecipient(idnum).AddressEntry.Address
End Function