I use the following macro (below), successfully, to format unformatted documents in Microsoft Word.
However, when I try to run the macro on a plain-text e-mail in Outlook, I receive the following message: "The macro Project1.Fix_Mail cannot be found."
So: is this a limitation of plain-text e-mails? If not, how can I modify the macro to work on plain-text e-mails?
Thanks so much!
====================
Sub Fix_Mail()
dowhat = wdFindStop
If Selection.Type = wdSelectionIP Then
Selection.HomeKey Unit:=wdStory
dowhat = wdFindContinue
End If
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = "@@@"
.Forward = True
.Wrap = dowhat
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "@@@@@@"
.Replacement.Text = "^p^p"
.Forward = True
.Wrap = dowhat
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "@@@"
.Replacement.Text = " "
.Forward = True
.Wrap = dowhat
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = dowhat
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub



