The problem is with the first line of your macro - selection.whole story.
Remove that line.
There are several bits of your macro that are unnecessary and some bits that
don't do anything. You could also reduce the number of steps by using
wildcards
http://www.gmayor.com/replace_using_wildcards.htm - and get rid
of all of it by using the stripmail utility linked from the downloads page
of my web site - but to tidy up your code to what I think you intended:
Sub CleanPartial()
' Macro recorded 1/25/2005 by Stephen Larivee
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Font.Name = "Times New Roman"
.Font.Size = 12
.Text = ">"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = "~"
.Replacement.Text = ""
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = "^l"
.Replacement.Text = "^p"
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = " ^p"
.Replacement.Text = "^p"
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = "^p "
.Replacement.Text = "^p"
End With
Selection.Find.Execute replace:=wdReplaceAll
'**********************************************
'what is this section supposed to be doing?
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
End With
Selection.Find.Execute replace:=wdReplaceAll
'and this
With Selection.Find
.Text = """"
.Replacement.Text = """"
End With
Selection.Find.Execute replace:=wdReplaceAll
'**************************************************
With Selection.Find
.Text = "^p^p^p"
.Replacement.Text = "^p^p"
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = "^p^p"
.Replacement.Text = "~~~~"
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = "~~~~"
.Replacement.Text = "^p^p"
End With
Selection.Find.Execute replace:=wdReplaceAll
With Selection.Find
.Text = " "
.Replacement.Text = " "
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>