Adding Macro to populate "to" "subject" "body" not deleting email string below.

Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
#1
I found macro details to enter the "to" "subject" and "body", however when using the signature and email string disappears. What i'm looking for is the code so that the email string below the body macro doesn't disappear.

My idea is to highlight a message I want to forward, then auto populating the To, Subject and body with certain text, it is working however i'm loosing the email string below.

Using Code:
Sub PreAlert()
Dim msg As Object
Set msg = Application.ActiveInspector.CurrentItem
msg.Forward
msg.To = "BT"
msg.Subject = "Pre-Alert: PO - FEDEX -"
msg.Body = "PREALERT" (would like to have a hard return inserted)
msg.Display
End Sub

Any Assistance would be greatly appreciated.

Thanks Eddy
 
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
#3
Thank you for your information, adding the code worked. However, what I had not mentioned and maybe I should have, the email is in HTML and needs to remain in HTML, as there are links in the body of the email that needs to remain. Adding the code kept the body however it changed to text. Is there a code that when forwarding the email, the body of the email would remain in HTML? Below is a sample of the email body. 1520857897028.png

1520857897028.png


Thanking you kindly,

Eddy Melsbach
 
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
#5
then use htmlbody: msg.htmlbody="xxx" & vbcrlf & msg.htmlbody

you might need to use html tags though:
msg.htmlbody="<p>xxx</p>" & msg.htmlbody

Thank you so much Diane,

This worked. Could you suggest a site where I can review all the VB code for outlook?

Thanking you kindly,

Eddy Melsbach
 

Similar threads

Top