\
Skip Navigation LinksHome > eZine > Ask Vance\
 
 
Vance Hunt has provided home-user help desk style support for his consulting company for over 6 years. Making his home in beautiful Southern California, Vance provides general computer Q&A for users via his weekly column.

[]View Current Column
[]Ask Vance A Question
[]Browse Other Dates



 
Icon of Vance HuntFriday, January 13, 2006
Auto format those incoming emails in Plain Text.
By Vance Hunt
 
Shout-Back! Read Comments  |  Post A Comment

Q: Is there a way to make Outlook convert incoming email messages from HTML to plain text automatically?
 
A: Incoming emails in HTML can be great from people you know, but a potential privacy and security risk when sent from strangers.   Although Outlook XP, 2003 and the upcoming version 12 allow you to specify the default format to write all your emails in, they don't have a realistic way to specify the incoming format.  All three of these versions let you open the email message, and then "Plain Text" from the Format menu. 

However, just because there is no available option via any of the dialogs doesn't mean you can't make Outlook automatically convert message via scripting.  These versions of Outlook let you create custom actions via macros and scripts.  Those scripts can then be used within rules.  Give this a try:

  1. From within Outlook, select Tools | Macros | Visual Basic Editor (Alt+F11), and then maximize the editor that opens.
  2. From the tree on the left, right-click on "Project1" and select Insert | Module
  3. A new folder and module option will appear in the tree.  On the right-pane, type in the following:

Sub ConvertHTMLToPlain(MyMail As MailItem)
    Dim strID As String
    Dim olNS As Outlook.NameSpace
    Dim olMail As Outlook.MailItem

    strID = MyMail.EntryID
    Set olNS = Application.GetNamespace("MAPI")
    Set olMail = olNS.GetItemFromID(strID)
    olMail.BodyFormat = olFormatPlain
    olMail.Save

    Set olMail = Nothing
    Set olNS = Nothing
End Sub

  1. From the File menu, select to Save Project1, then exit from the editor
  2. From the main Outlook window,  select Tools | Rules and Alerts
  3. I'm not going to go over the rules creation wizards, so if you're not familiar with them, read the online documentation.  What I want to point out here is an option now available to you, and I'll do this by creating a very generic rule. 
    1. Press New Rule
    2. Select "Start from a blank rule"
    3. Select "Check messages when they arrive", and press Next
    4. Do not select any "Step 1" boxes, and press Next, and then Yes on the warning message that says this rule will be applied against all incoming messages.
    5. Scroll down, and select "run a script".  Then, click on the underlined word: script.  A dialog will pop up showing the function you just created.  Select the function.
    6. Click Next, Next, Finish and OK
  4. Now that you have a new rule, you'll need to either wait until a new message comes in, or you can create an HTML message and send it to yourself.  When you open it, you'll see that the message is displayed in plain text.

This custom action is used by creating a VBA applet.  VBA is a scripting platform available in not only all Microsoft Office applications, but many other applications as well.  This particular applet is included in the book Microsoft Outlook Programming, Jumpstart for Administrators, Developers, and Power Users by Sue Mosher and available freely on-line here.   If you like the idea of creating your own custom actions, you might want to give this book a look.




Comments: [0]   [Show Disclaimer]

Post a Comment
Display Name:
Comment:
(Plain text only - all HTML will be stripped)

Previous Ask Vance Questions:

 FAQs  |  Terms Of Use  |  Privacy Policy  |  Contact Us
Copyright © 1997 - 2010 Dx21, LLC. All rights reserved.
Dx21, LLC a Washington Limited Liability Company
Page Rendered at: 9/9/2010 12:15:46 PM for Unknown