2
2Catman
I need to loop the following code until the end of a document (of
comma-delimited library records):
Sub Test_find_count()
'
' Test_find_count Macro
' Macro recorded 12/5/2005 by
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""","
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
For X = 1 To 11
Selection.Find.Execute
Next X
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=", "
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub
comma-delimited library records):
Sub Test_find_count()
'
' Test_find_count Macro
' Macro recorded 12/5/2005 by
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""","
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
For X = 1 To 11
Selection.Find.Execute
Next X
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=", "
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub