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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
Thread starter Similar threads Forum Replies Date
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
N Forwarding email Using Outlook 5
A When forwarding attachments, the email address of recipient is lost Using Outlook 2
D Automatically close received email when forwarding r replying Using Outlook 1
S Program shuts down when forwarding an email Using Outlook 1
G When forwarding an email that I've received with a hyperlink, the hyperlink stops working- Outlook 2 Using Outlook 3
D Unattach an email address from forwarding in microsoft outlook Using Outlook 1
N Problem in Forwarding Email Using Outlook 5
V Re: Email Forwarding Outlook VBA and Custom Forms 1
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
T Automatic forwarding rule strips attachment Using Outlook 3
C How do I cancel automatic e-mail forwarding? Using Outlook 1
M Quick steps: feature request: 'direct replies to' when forwarding Using Outlook 1
A How do I stop automatic e-mail forwarding? Using Outlook 2
J CONTACTING SERVER...Message on Printing and forwarding certain html rich mails . How to disable. Using Outlook 3
B OUTLOOK MEETING INVITES - NOT ALLOW FORWARDING Using Outlook 1
S Allow forwarding to External domain Exchange Server Administration 1
C How to change order of colors used when replying or forwarding Using Outlook 2
D OWA on 2010 CAS not forwarding authentication to 2003 OWA for legacy users Exchange Server Administration 1
J How to keep people from forwarding calendar invites to others Using Outlook 4
Similar threads


















































Top