Forwarding email and replacing body

Status
Not open for further replies.

Amy2704

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Outlook.com (as MS Exchange)
Morning,

I am wanting to to create a VBA which will amend the body of a email before it is forward via rules.

The emails are coming from specific addresses. I need to be able to pick these emails up, amend the wording and then forward them. I don't want the forwarding information in the email that is getting sent.

As the original email was forwarded and then i forward the email again it shows it has been forward twice. I want this removing and inserting some text of my own.

Can anyone please advise. I am very very new to Outlook VBA.

Thank you
 
i have several sample scripts at slipstick.com - this is one - Run a Script Rule: Change Subject then Forward Message

if you wanted to forward the exact message you received, you'd use


Sub ChangeSubjectForward(Item As Outlook.MailItem)
Set myForward = Item.Forward
myForward.Recipients.Add "alias@domain.com"
myForward.body = item.body
myForward.Send
End Sub

if you need to edit the message, you need to use instr/mid functions or regex to strip out the previous forward header. if the subject is always identical, you could use something like this to get the body:
int = InStr(1, item.body, "subject-name")
strbody = right(item.body, len(item.body) - int)
myForward.body = strbody

if it's an html message, you may need to use .htmlbody instead of .body
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A Outlook 2019 Help with forwarding email without mentioning the previous email sender. Outlook VBA and Custom Forms 0
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
T Original email text not shown when replying or forwarding the email. Using Outlook 9
D Keep Original html body when forwarding an email Outlook VBA and Custom Forms 7
I Forwarding attachments in email received Outlook VBA and Custom Forms 3
D VBA to edit body of incoming email and forwarding it Outlook VBA and Custom Forms 11
G VBA/Macro to remove page colour when replying or forwarding email Outlook VBA and Custom Forms 2
N Auto-forwarding an Email received from a specific Email address After slight modifications Using Outlook 4
D Forwarding Exchange Email without meeting updates Using Outlook 1
P Forwarding Email With Encrypted Attachment Exchange Server Administration 1
V Re: Email Forwarding Outlook VBA and Custom Forms 1
F Outlook 2019 Forwarding Message and Keeping Unread Status Outlook VBA and Custom Forms 0
A Automatic forwarding to different people on a rotational basis Using Outlook 2
R Auto Forwarding with different "From" Outlook VBA and Custom Forms 0
P Forwarding emails issue with special characters replacing text body Using Outlook 1
S Customize the autocolor font choices for replying/forwarding messages Outlook VBA and Custom Forms 2
R Retain Original Message When Forwarding With Macro Outlook VBA and Custom Forms 3
M VBA Rule for removing all body but hyperlink then forwarding Outlook VBA and Custom Forms 9
W Forwarding E-Mail Outlook VBA and Custom Forms 13
D VBA Code to strip Subject Line when replying or forwarding Using Outlook 3
R Forwarding and keeping Original intact Using Outlook 3
J Creating a URL from a message body excerpt before forwarding Using Outlook 2
J Outlook Rule - Create Link in Forwarding Message Outlook VBA and Custom Forms 2
E Contact's Notes field not transferring when forwarding vCard Using Outlook 6
J Meeting Invites Go Blank When Forwarding or Accepting Using Outlook 2
A Emails automatically forwarding but no rule to turn off Using Outlook 2
T Adding text to forwarding rules in Outlook 2010 Using Outlook 1
T Adding tex to forwarding rules in Outlook 2010 Exchange Server Administration 1
L Forwarding an expiring message Using Outlook 0
T To: and Cc: not displaying when forwarding/replying to .eml files Using Outlook 4
V Reply Arrow Icon appears when both Replying or Forwarding Using Outlook 3
C forwarding from 365 to hotmail account? Using Outlook 1
F VB Script, remove text from subject line when forwarding Using Outlook 22
C Forwarding Outlook 2003 calendar items Using Outlook 1
B Outlook 2003 randomly not auto forwarding Using Outlook 0
M Forwarding vCard prompts Send As (From field) on Contacts that were moved Using Outlook 6
B OL2010 - signatures while forwarding tasks or appointments Using Outlook 2
D Private messages not forwarding by rule? Outlook 2007 Using Outlook 1
T [outlook-users] e masil forwarding Using Outlook 2
A Font size increases when forwarding emails Using Outlook 1
A Forwarding recurring appointment/meeting Using Outlook 2
A How do I move a message to a folder after forwarding ? Outlook VBA and Custom Forms 6
V Remove old recipients before forwarding Outlook VBA and Custom Forms 1
A How to change message format while forwarding a mail Outlook VBA and Custom Forms 1
Y QQ on Scheduled Delivery of an Email Using Outlook 0
T Replace Text in Email Subject Outlook VBA and Custom Forms 3
Rupert Dragwater Cannot reestablish gmail (email address) account in Outlook 365 Using Outlook 12
M Outlook 365 adding standard message in body of template email Outlook VBA and Custom Forms 3
E Create Rule to Forward Email if Subject Begins With Using Outlook 2
V iCloud For Windows v15.x - Missing Email Features ? Using Outlook 4

Similar threads

Back
Top