Answers:
如果您担心显示而不真正需要转换,请参见此处以获取“以纯文本格式阅读”的说明 http://support.microsoft.com/kb/831607
您可以使用VBA编辑消息。根据MSDN,如果将_MailItem.BodyFormat
属性设置为olFormatPlain
它会丢弃所有格式。
有关将VBA用作Outlook过滤规则的更强大替代方法的这篇文章应该为您提供正确的方向。
可以在此处找到包含所需VBA的规则以及ItemAdd和NewMailEx代用词。
http://www.outlookcode.com/article.aspx?id=62
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
对于ItemAdd和NewMailEx解决方案,您可以通过像这样测试SenderName或SenderEmailAddress来限制转换。
If objMail.SenderName = "Mailer, HTML" Then
objMail.BodyFormat = olFormatPlain
objMail.Save
End if
您可以找到带有此名称的SenderName。(由于未知原因,我的发件人之一没有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