Avatar of nrthelp
nrthelp

asked on 

How to strip defined text from email body in OUTLOOK & fwd message

I want to strip out some predefined text/html lines from a body of an imcoming email and then forward the email in OUTLOOK.

For example:

Body = Hello World!
Predefined text to be striped out = Hello
Forward Email Body = World!

Thanks!
SoftwareOutlook

Avatar of undefined
Last Comment
David Lee
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, nrthelp.

I can help you with this.  There is one problem though.  Outlook 2003 doesn't allow code/scripts to send messages.  When they do Outlook pops up a dialog-box warning that an application is trying to send and asking for your permission to allow it to continue.  That kills this as an automated process.  There is no way to turn that behavior off, although there are ways to work around it.

1.  Use Click-Yes (http://www.contextmagic.com/express-clickyes).  This is a utility that sits in the system tray and watches for the confirmation dialog-box.  When one appears it clicks Yes for you.
2.  Use Outlook Redemption (http://www.dimastr.com).  This is a COM component that allows code to safely circumvent Outlook security.
3.  Get a digital certificate and sign the code.
Avatar of nrthelp
nrthelp

ASKER

i used clickyes before -- its easy to use.  Getting a digital certificate and sign the code is that difficult to do?  If so,  I can go with the clickyes option.  Can you provide me with some sample code for trimming and fowarding the email.  Thanks!!
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of nrthelp
nrthelp

ASKER

This is exactly what I needed & I assume if I want replace HTML code in email.  I use .Body = Replace(olkForward.Body, "<br><p>Hello</p>", " ')

The incoming email is html email and I'd like to remove the first paragraph and header - is it safe say I can modify your code and use with html emails?

Thank you!!
Avatar of David Lee
David Lee
Flag of United States of America image

Close.  There's a separate property for the HTML version of a message.  Its called HTMLBody.  If you want to replace HTML, then substitute HTMLBody for Body.
Outlook
Outlook

Microsoft Outlook is a personal information manager from Microsoft, available as a part of the Microsoft Office suite. Although often used mainly as an email application, it also includes a calendar, task manager, contact manager, note-taker, journal, and web browser.

105K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo