We all have those people who decide to put a ton of junk mark-up in their emails and make it nearly impossible to read. What I'd like to have is a rule in Outlook 2010 that as soon as an email comes from a certain person (or probably group) it automatically converts it to plain-text instead of html. Any ideas?
If you are concerned about the display and do not really need to convert see here for instructions to "Read as Plain Text" http://support.microsoft.com/kb/831607
I "solved" this same problem by assigning a mail rule to pick up only the specific problem email/s, and moves it to "Junk". In junk, all emails are converted to plain text.
Thus I read these problem emails in my junk folder, which is much better than the status quo of outlook "not responding" for a minute every time I accidentally preview the problem email.
EDIT: I also added a notification alert to the mail rule so that I wouldn't "miss" the email
You can edit a message with VBA. According to the MSDN, if you set the
_MailItem.BodyFormat property to
olFormatPlain it will discard all formatting.
This article on using VBA as a more powerful alternative to the Outlook filtering rules should set you in the right direction.
A rule that incorporates the VBA required can be found here, with ItemAdd and NewMailEx alernatives.
Sub ConvertToPlain(MyMail As MailItem) Dim strID As String Dim objMail As Outlook.MailItem strID = MyMail.EntryID Set objMail = Application.Session.GetItemFromID(strID) objMail.BodyFormat = olFormatPlain objMail.Save Set objMail = Nothing End Sub
For the ItemAdd and NewMailEx solutions you can limit the conversion by testing for the SenderName or SenderEmailAddress like this.
If objMail.SenderName = "Mailer, HTML" Then objMail.BodyFormat = olFormatPlain objMail.Save End if
You can find the SenderName with this. (For unknown reasons one of my senders does not have a SenderEmailAddress.)
Sub Addresses_CurrentItem() Dim olMail As Object On Error Resume Next Set olMail = ActiveInspector.currentItem If olMail Is Nothing Then ' might be in the explorer window If (ActiveExplorer.selection.Count = 1) And _ (ActiveExplorer.selection.Item(1).Class = olMail) Then Set olMail = ActiveExplorer.selection.Item(1) End If End If On Error GoTo 0 If olMail Is Nothing Then MsgBox "Problem." & vbCr & vbCr & "Try again " & _ "under one of the following conditions:" & vbCr & _ "-- You are viewing a single email message." & vbCr & _ "-- You have only one message selected.", _ vbInformation Exit Sub End If If TypeOf olMail Is MailItem Then Debug.Print " Sender : " & olMail.SenderName Debug.Print " SenderEmailAddress: " & olMail.SenderEmailAddress & vbCr End If End Sub