Keep Original html body when forwarding an email

Status
Not open for further replies.

DAVID POWELL

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
This code is wiping out my original mail with text and html
I want to retain the original message and just add something at the top ?

add this : "This is Rejected"


Sub CommandButton6_click()

ChangeSubjectForward Item

End sub

Sub ChangeSubjectForward(Item)
Item.Subject = "Test"
Set myForward = Item.Forward
myForward.Recipients.Add "ccccc.ccccell@somewhere.com"
myForward.Body = "This is Rejected"
Item.Save
myForward.Send
End Sub

Thanks
david powell
 

DAVID POWELL

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Sub ChangeSubjectForward(Item)
Item.Subject = "Test"
Set myForward = Item.Forward
myForward.Recipients.Add "test@domain.com"
myForward.HTMLBody = "This is Rejected" & myForward.htmlbody
myForward.Send
End Sub

This seems to work
is there another way ?

Thanks
David Powell
 
Last edited by a moderator:

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
That is the easiest, most efficient way... you could use word vba to insert text before - an example code is here - Add Attachment Names to Message Before Sending

it's an additional 10 lines - i would probably only use it in your situation if the html body gets messed by the additional code. if you need an extra line between the text and the original body, try using either html tags or adding vbcrlf.
 

DAVID POWELL

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Diane,
Actually yes, i'm needing an extra line after:
myForward.HTMLBody = "This is Rejected" & myForward.htmlbody

Because I want it to read:

This is rejected

Blah blah blah blah

html stuff
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Try using
myForward.HTMLBody = "<p>This is Rejected</p>" & myForward.HTMLBody

The sample with more space used the p tags, the top one is using your initial code. Using 2 <br /> tags is the same as using the p tags:
myForward.HTMLBody = "This is Rejected <br /><br />" & myForward.HTMLBody
samples.png
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
BTW, you can use html styles too - just use single quote, not double, with style:
myForward.HTMLBody = "<p style='color:red; font-size:18pt'>This is Rejected. </p><p>Try again. </p>" & myForward.HTMLBody
sample-2.png
 

DAVID POWELL

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
this worked:
eBody = "I Have Reviewed and Approved the following pricing escalation." & "<br>" _
& "Please Review the Request and advise if you support the links below." & "<br>" _
& myForward.HTMLBody


Thanks for direction
dp
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
H Keep Original email unread after autoreply Outlook VBA and Custom Forms 2
R keep track of the original sender Outlook VBA and Custom Forms 3
T Why is every new email pinned (to keep it on top)? Windows 10 Using Outlook 6
T Missing text in e-mail message after "(Please keep confidential)" Using Outlook 3
CWM030 Outlook 2016 with imap emails keep Resurrecting themselves? Using Outlook 5
O Wishlist Native solution to detach attachments but keep a link to them Outlook Wishlist 1
Scorpion New Contacts keep coming up as company Using Outlook 1
M Multiple workstations and multiple accounts - keep in sync? Using Outlook.com accounts in Outlook 2
M How to keep reccurence during copy tasks to calendar? Using Outlook 1
Patrick van Berkel Best way to share (and keep up-to-date) Macro's in Outlook 2010 Outlook VBA and Custom Forms 6
Karsten V Reminders keep popping up way after past reject Using Outlook 0
A Keep color categories when saving vCards Using Outlook 1
Mark Klaassen HOw to keep Outlook iCloud add-in enabled Using Outlook 4
R Can't keep emails synced on various devices Using Outlook.com accounts in Outlook 4
piusg 2013: Task Views keep disappearing Using Outlook 4
Dan Badur How can I keep indenting OFF on replies in Outlook 2013? Using Outlook 1
S how to keep "To" when move sent emails to other folder Using Outlook 1
K Deleted emails keep coming back Using Outlook 3
D Need Help with Script. Keep getting Runtime Error 438 BCM (Business Contact Manager) 4
A How to add personal notes to a meeting - and keep them if update sent? Using Outlook 1
A outlook trying to keep sending Using Outlook 1
B Closing Exchange service, how to keep all calendar and mail data? Exchange Server Administration 0
D How to keep Outlook 7 open to full screen Using Outlook 2
S How do I keep my old PST file as default Exchange Server Administration 1
Z Keep Unread Messages in same folder Using Outlook 2
L Oulook always "disconnected" how do I keep it open all of the time? Using Outlook 1
P emails with attachments keep sending... HELP!!! Using Outlook 4
F Not keep sort order after re-change column Using Outlook 1
M How do you keep sent emails in the PST folder in outlook 2013 Using Outlook 1
N Contact Groups - names keep changing from Contacts to AddressBook Using Outlook 5
M Reminders keep coming to users' calendar Exchange Server Administration 1
L Outlook 2010 - Keep getting "Corrupted File" Msgs Using Outlook 4
W Outlook 2010 Share calendar but keep color formatting Using Outlook 2
mrje1 Assigned Categories keep getting deleted in mail, bug? How to fix if possible? Using Outlook 5
S Reminders keep popping up, even after dismissing them Using Outlook 9
T Outlook keep loosing connection to the exchange server Using Outlook 1
P deleted items keep reappearing in my deleted folder Using Outlook 4
P Stationary and view layout keep changing after reboot? Using Outlook 1
Y MICROSOFT OUTLOOK 2007 - i KEEP GETTING THE "ENTER NETWORK PASSWORD" BOX POPPING UP - IT IS ALREADY Using Outlook 4
A How to keep all conversations expanded? Using Outlook 3
Q I cannot start Outlook 2007 I keep getting this error: __'Cannot start outlook window. Invalid XML,the view cannot be loaded.' Using Outlook 3
S Deleted messages keep coming back Using Outlook 7
A Keep format of message in the body Outlook VBA and Custom Forms 1
R How do I keep old calendar events from disappearing? BCM (Business Contact Manager) 2
C Reminders keep appearing without being requested BCM (Business Contact Manager) 4
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
S Email Generated from another program and then edited sends original email. Using Outlook 2
T Original email text not shown when replying or forwarding the email. Using Outlook 6
Bering Forward selected email without the original email appended Outlook VBA and Custom Forms 0
B disappearing original when attach to email Using Outlook 1

Similar threads

Top