• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

Batch Convert Oultook Messages from HTML/RTF to Plain Text

Looking to see if there is a utility that will allow me to convert a bunch of messages from HTML/RTF to Plain Text in Outlook 2003/2007.
0
RTM2007
Asked:
RTM2007
  • 4
  • 3
1 Solution
 
RTM2007Author Commented:
No.
I am looking for a way to convert a select number of, or all, messages to Plain Text from HTML in Outlook.
0
 
David LeeCommented:
Hi, RTM2007.

Are the message in Outlook?
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
RTM2007Author Commented:
Yes.

So essentially lets say I have a folder of messages in Outlook where every message came in as an HTML message.

Instead of opening up each one then editing the message and converting it to plain text, I would like to be able to select a bunch of them to automatically convert to plain text.
0
 
David LeeCommented:
That's simple.  The code below will handle this for you.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on Module1
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Click the diskette icon on the toolbar to save the changes
6.  Close the VB Editor
7.  Select the messages you want to convert.  
8.  Run the macro

Sub ConvertToPlainText()
    Dim olkMsg As Outlook.MailItem
    For Each olkMsg In Outlook.Application.ActiveExplorer.Selection
        olkMsg.BodyFormat = olFormatPlain
        olkMsg.Save
    Next
    Set olkMsg = Nothing
    MsgBox "Done"
End Sub

Open in new window

0
 
RTM2007Author Commented:
Ok I get the error when I try to run (verified security as low/off):

The macros in this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros.
0
 
David LeeCommented:
Add this code to the ThisOutlookSession module in Outlook.  Close and restart Outlook.  On startup you'll get a message asking if you want to enable macros.  Say yes.  You can delete the code once macros are enabled.
Private Sub Application_Startup()
    MsgBox "Hello world"
End Sub

Open in new window

0
 
RTM2007Author Commented:
Ok I tried that but when I open Outlook I do not get a message.

Running Outlook 07 SP2. Copy/pasted the above lines 1, 2, 3 into ThisOutlookSession
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now