I cannot determine what command is needed to restrict the following macro, created using the macro recorder, to my selection. I have looked through all my other macros and can't figure out what allows some of them to operate this way. One them works one the whole document if I select nothing, or works on a selection, but why is beyond me, except that it's useful. I have tried to use the recorder to isolate this aspect, to no avail.
Thanks in advance!
Code:
Sub ParasStripSelected()
'
' ParasStripSelected Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.MoveLeft Unit:=wdCharacter, Count:=1
End Sub
I suspect that al those = False lines could be deleted, but I'll wait to have a working macro to try that out.