Link to home
Start Free TrialLog in
Avatar of Starquest321
Starquest321

asked on

Creating Outlook Rule to strip HTML

I have a rule set up to move certain email from a specified user to a folder. However I would like the rule to strip out the HTML. There is no option for that . . .in Outlook 2007. . . any ideas?
Thanks
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, Starquest321.

There is no option for stripping HTML in any version of Outlook.  The closest I think you can get is to run some code that converts the messages to plain-text format.
Avatar of Starquest321
Starquest321

ASKER

Do you have a code like that available that you can share with me? But remember I just want to do it when a specific rule is applied. . .
Add this code to any module in Outlook's VB editor.  Change your rule to run this macro.  It will check each message that meets the rule's conditions.  If the message is in HTML format, then it will change it to plain-text format.

Sub ChangeBodyFormat(Item As MailItem)
    If Item.BodyFormat = olFormatHTML Then
        Item.BodyFormat = olFormatPlain
        Item.Save
    End If
End Sub
What do you mean by module?
This is excellent - just exactly what I was looking for!
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial