Displaying "From" information in message box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the piece of code below attached to a button so that when it is pressed, it displays the email address of who sent the email on the screen

Set objIEApp = CreateObject("InternetExplorer.Application"

MsgBox " The email eddress of the sender is " & myinspector.CurrentItem.Reply.T

This code worked fine until i came across an email in which the from field was of this format "Joe Bloggs [joe.bloggs.co.uk]

Now my message box just displays the name and not the email address

What field to i need to attach to my code so that if i encounter in email with both a name and an email, it will display both in my message box

Thanks
 
First of all, ReplyTo isn't necessarily the original From address. The
sender can set a different ReplyTo.

In Outlook 2003 there's a SenderEmailAddress property. In earlier versions
of Outlook you would need to use CDO 1.21 code, Extended MAPI or Redemption
(www.dimastr.com/redemption) to get the actual From address.

See http://www.slovaktech.com/code_samples.htm#FromAddress for a CDO 1.21
code sample.




Gillian Donald said:
I am using the piece of code below attached to a button so that when it is
pressed, it displays the email address of who sent the email on the screen.
Set objIEApp = CreateObject("InternetExplorer.Application")

MsgBox " The email eddress of the sender is " & myinspector.CurrentItem.Reply.To

This code worked fine until i came across an email in which the from field
was of this format "Joe Bloggs [joe.bloggs.co.uk]"
Now my message box just displays the name and not the email address.

What field to i need to attach to my code so that if i encounter in email
with both a name and an email, it will display both in my message box.
 
Back
Top