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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook 2000: How do I retrieve an Email Address

Status
Not open for further replies.

IanGalletly

Programmer
Jun 17, 2003
16
0
0
GB
Once I have a objMailItem set up, how do I get to the actual email address of the recipient if the recipient is recognised by outlook and therefore the '.To' returns the 'Display Name' rather than the email address.

I'm sure this should be blindingly simple - I'm just going round in circles!



Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")

Set objInBoxFolder = objNameSpace.GetDefaultFolder(olFolderInbox)


For Each objMailItem In objInBoxFolder.Items

With objMailItem

OTE_InBoxTo = .To

' Need OTE_InBoxTo to have actual email address
' e.g. ian.galletly@host.co.uk
' If ian.galletly@host.co.uk is setup as a contact's
' email Address I'm getting 'Ian Galletly'


End With

Next objMailItem



Any help would be appriciated
 
Don't know much about it myself (we use lotus notes here [evil]) but there is an article on about using CDO to get at the address.

hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top