Outlook 2007 - Replace email body with custom text

Status
Not open for further replies.

divan

Member
Outlook version
Email Account
POP3
I have a rule to run a script upon receiving email from a specific account.

The script takes the email body and place it in my subject (placing my subject with body)

Now I want the script to remove or clear the email body before it forwards it to the email recipient, I want it to be black or with custom text.

This is my script:
Sub ChangeSubjectForward(Item As Outlook.MailItem)
Item.Subject = Item.Body
Item.Save
Set myForward = Item.Forward
myForward.Recipients.Add "fake_email@gmail.com"
myForward.Subject = Item.Body
myForward.Body = "XYZ"
myForward.Send

End Sub
___________________________________________________


My script does add the XYZ into the body and appears to send it as a email with body "XYZ" .....but this is what I get on the received email body:


Date: Thu, 15 Jan 2015 20:50:51 +0200

Message-ID: <000001d030f4$30db3450$92919cf0$@co.za>

MIME-Version: 1.0

Content-Type: text/plain;

charset="us-ascii"

Content-Transfer-Encoding: 7bit

X-Mailer: Microsoft Office Outlook 12.0

Thread-Index: AdAxWK3sf5r0IidSSTii+P0kIpfaEgAZIF+A

Content-Language: en-za

x-cr-hashedpuzzle: AMFR AjsP BRgi Bbgt B8Kp CGRh DIOr DSp2 DSt4 DbAo Dl8w D9Dg E0H+ E/H4 G7XL Hbpr;1;YwB0AHMAdABvAHIAZQBAAGsAbwB2AGMAbwAuAGMAbwAuAHoAYQA=;Sosha1_v1;7;{B5928C4F-F89F-42CA-A50D-293A9CEE100A};eABvAGwAYQBAAHgAbwBsAGEALgBjAG8ALgB6AGEA;Thu, 15 Jan 2015 18:50:47 GMT;VABlAHMAdABpAG4AZwAgAHQAaABlACAAbQBhAGkAbAA=

x-cr-puzzleid: {B5928C4F-F89F-42CA-A50D-293A9CEE100A}


XYZ
 
If I send a mail with no body to my outlook with script, then the forwarded email (from outlook with script) has only the body which I added in the scrip.
But when the email has text in body my outlook script does not remove or clear the sent email.body.

This is what is added which I want removed completely:

Date: Mon, 19 Jan 2015 08:42:28 +0200
Message-ID: <000001d033b3$1a2ec660$4e8c5320$@co.za>
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AdAzsgvdJDRuShGcSiaP+wcwbJIN/QAAQvAw
Content-Language: en-za

XYZ
 
I'd check the Body content that you add to the Subject property. It looks like the stuff you're copying to the Subject is not allowed and kind of corrupts the email.
 
I am only using script to copy over... where or how can I adjust it?

This is my script:
Sub ChangeSubjectForward(Item As Outlook.MailItem)
Item.Subject = Item.Body
Item.Save
Set myForward = Item.Forward
myForward.Recipients.Add "fake_email@gmail.com"
myForward.Subject = Item.Body
myForward.Body = "XYZ"
myForward.Send
 
The I have a CCTV system that sends a email when a movement alarm is triggered. Now I want to send the email to another system in a specific format so that it can be converted into a sms.
The SMS system uses the subject of the email as the sms and the body as the destination, thus me wanting to have limited characters in the subject and be able to have the body to only show what I put in, like my example of "XYZ"

This is what is the format that can not be altered on the CCTV system itself:
Email Subject:
Movement Alarm
Email Body:
Unit: 0 Version:03.091
Movement Alarm
Continuous Movement
Back Office
Zone 3
2015/01/20 @ 07h15
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Outlook 2007 Recovering E-Mails Using Outlook 0
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
M Configure outlook 2007 to accept digital signatures Using Outlook 2
D Outlook 2007 crashes when opening an email Using Outlook 2
R New chap saying hello and needing advice on Outlook 2007 thumbnails Using Outlook 3
icacream From Outlook 2007 to 2016 ! Using Outlook 9
vodkasoda Object could not be found Error in Outlook 2007 Outlook VBA and Custom Forms 5
S Outlook 2007: Address Cards allow entering text! Why? Using Outlook 3
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
L Outlook 2007 Separate the Send/Receive functions Using Outlook 2
M Outlook 2007 Contacts Glitch: Creating a new email Using Outlook 1
C Move from Outlook 2007 Enterprise (MOE) to Outlook Pro plus 2007 Using Outlook 1
J reinstalling Outlook 2007 asking for user name & password Using Outlook 14
P outlook addin unloaded in office 2007 Using Outlook 0
B Fonts in Outlook 2007 Using Outlook 4
R Add Exchange Account to existing POP3 Outlook 2007 Profile Using Outlook 0
C out of space in file group Outlook 2007 Using Outlook 2
A Moving archived contents in Outlook 2007 back into working folders Using Outlook 0
P Outlook 2007 Email Categorization using VBA Outlook VBA and Custom Forms 1
M Unable to Configure Gmail Account in Outlook 2007 Using Outlook 1
R Outlook 2007 or 2010 - Lock Down Functionality Outlook VBA and Custom Forms 3
S Outlook 2007, windows 10 Font size Using Outlook 1
Diane Poremsky Manually create a POP3 account in Outlook 2007 Using Outlook 0
J Can Click to Drag Custom Form Field But Cannot Drop When Designing in Outlook 2007 Outlook VBA and Custom Forms 2
L Outlook 2007 Font Using Outlook 3
J Outlook 2007 connector and Windows 10 Using Outlook 3
R Outlook 2007 - Shared Accounts and Resources without Exchange Server Using Outlook 0
L Outlook 2007 - Macro Re Search Using Outlook 16
D Outlook (Office) 2007 & Windows 10 Pro Using Outlook 6

Similar threads

Back
Top