View Single Post
  #2  
Old May 20th 10, 03:06 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Forward Email and Insert Sender's Email address in body

One post would have been enough.

You want the sender's email address from the ThisItem object?

Use ThisItem.SenderEmailAddress for that. Be aware though that if your
sender is an Exchange user in the same domain you are in (if you use
Exchange) that the result will be an Exchange DN and not an SMTP address.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"LDMueller" wrote in message
...
With the help of this awesome site, I've created the following code. The
only part which I can't figure out is how to insert the email address of
the
sender in the
"Senders Email Address Here" area.

Sub Whitelist()
On Error Resume Next
Set ThisItem = Application.ActiveInspector.CurrentItem
Set fwdItem = ThisItem.Forward
fwdItem.To = "
fwdItem.subject = "Whitelist"
fwdItem.HTMLBody = "pPlease whitelist the following:/pp/p" &
vbCrLf & _
"Senders Email Address Here" & _
vbCrLf & fwdItem.HTMLBody
fwdItem.Send
End Sub

Can anyone help me?

Thanks so much in advance!

LDMueller


Ads