I'm trying to run what I thought was a simple search & replace macro in Word 2011, to replace manual line breaks with paragraph marks. The macro is:
Sub ReplaceManualLineBreaks()
'
' ReplaceManualLineBreaks Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^|"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
However, on running it, I get the error message:
Run-time error '5625':
{a} is not a valid special character for the Find What box.
When I opt or debug, that line near then end - Selection.Find.Execute Replace:=wdReplaceAll - is highlighted. Any thoughts?