outlook forward macro

P

Phil Best

Would like to create macro to forward message adding the following text to
body.
"Sue"
"Please approve enclosed forecast change request and forward to Bops"
"Regards"
"Phil"
Writing macro to forward is straight forward but struggling to work out how
to add text. Would like add text to be in bold and coloured blue.
 
M

Michael Bauer

Am Fri, 14 Jul 2006 06:16:03 -0700 schrieb Phil Best:

You can call an MailItem´s Forward function which returns a new MailItem
object. Then you can write into its HTMLBody property, example inserts your
text at the top:

HTMLBody = "Your text" & vbCRLF & HTMLBody

For the formatting you need to enclose your text in the proper HTML tags.
<b> is for bold, <color=#0000ff> is for blue.
 
P

Phil Best

Dose not seem to work. Happy to admit that VB is not my best skill. I enclose
the script I am using and would be obliged if you would advise where I am
going wrong.
Sub Forward()
On Error Resume Next
Set ThisItem = Application.ActiveInspector.CurrentItem
Set FwdItem = ThisItem.Forward
FwdItem.To = "[email protected]"
HTMLBody = "Your text" & vbCrLf & HTMLBody
FwdItem.Send
End Sub
 
M

Michael Bauer

Am Mon, 17 Jul 2006 01:07:02 -0700 schrieb Phil Best:

Please write FwdItem.HTMLBody instead of HTMLBody.
 
P

Phil Best

Michael
Made the change but the only text that appears on the forwarded email is
"Your Text". The original text disappears. Macro enclosed
Sub Forward()
On Error Resume Next
Set ThisItem = Application.ActiveInspector.CurrentItem
Set Fwditem = ThisItem.Forward
Fwditem.To = "[email protected]"
Fwditem.HTMLBody = "Your Text" & vbCrLf & HTMLBody
Fwditem.Send
End Sub
 
M

Michael Bauer

Am Tue, 18 Jul 2006 03:18:02 -0700 schrieb Phil Best:
Fwditem.HTMLBody = "Your Text" & vbCrLf & HTMLBody

At the end is another HTMLBody which needs to be full qualified.
 
Top