General discussion
June 18, 2005 at 02:38 AM
georgerooker

Email sender’s address

by georgerooker . Updated 21 years, 3 months ago

I am able to read and extract data from emails in Access using VBA code like this:

Dim SubFolder As Outlook.MAPIFolder
Dim MailMsg As Outlook.MailItem

For Each MailMsg In SubFolder.Items
MailMsg.To
MailMsg.SenderName
MailMsg.Subject
MailMsg.Body

Usually the sender’s email address is found in the SenderName, occasionally in the Body – and sometimes nowhere at all.

Sometimes the SenderName only returns the display name (eg. ‘Ryan’ not ‘ryan89@abc.com’). Where is the email address? Oddly, if you print out the email it shows it, eg:
From: Ryan [ryan89@abc.com]
Sent: 26 May 2005 13:01

Can anyone help me solve this?
Thanks.

This discussion is locked

All Comments