P
Pedro Baiano
Hello guys:
I need a macro to find 2-3 spaces and replace that with one space. That is
pretty simple. My problem is that the user has to decide in each instance if
s/he wants to replace it or not. Like when you use the Find & Replace box. It
should be inside a macro as it is one of many Find & Replaces for a final
editing of a doc.
What have I done so far (it works, but does not stop in each instance):
Sub Spaces_Space()
'
' Spaces_Space Macro
' Macro recorded 05/12/2007 by /
'
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " {2,3}"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Thank you,
P.
I need a macro to find 2-3 spaces and replace that with one space. That is
pretty simple. My problem is that the user has to decide in each instance if
s/he wants to replace it or not. Like when you use the Find & Replace box. It
should be inside a macro as it is one of many Find & Replaces for a final
editing of a doc.
What have I done so far (it works, but does not stop in each instance):
Sub Spaces_Space()
'
' Spaces_Space Macro
' Macro recorded 05/12/2007 by /
'
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " {2,3}"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Thank you,
P.