Need to Count the replacements made by a VBA macro in a Word 2003...
We have a bunch of VBA that does a lot of cleanup work in some fancy documents. As these VBA run we would like to display the amount of changes made to the document. Is that possible?
Jim Dunn
Yes. We can do.
Example: Dim cou as integer Selection.HomeKey unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = FindText .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = True .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False While .Execute cou=cou+1 'Write code to replace selection text here Selection.Collapse direction:=wdCollapseEnd Wend End With Msgbox cou