A
and
Hi,
I want to replace all instances of multiple consecutive spaces in a
document.
When I record a Find & Replace command, 2 spaces are replaced with 1.
And 3 spaces become 2; 4 become 3, etcetera, so multiple spaces still exist.
This is the recorded code from Word XP.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
How can I efficiently change the code so it goes on replacing multiple
spaces until only single spaces are left?
Best regards,
ANDy
I want to replace all instances of multiple consecutive spaces in a
document.
When I record a Find & Replace command, 2 spaces are replaced with 1.
And 3 spaces become 2; 4 become 3, etcetera, so multiple spaces still exist.
This is the recorded code from Word XP.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
How can I efficiently change the code so it goes on replacing multiple
spaces until only single spaces are left?
Best regards,
ANDy