General discussion
September 18, 2002 at 04:19 AM
dakota99

Word Macro not changing data

by dakota99 . Updated 23 years, 12 months ago

I have a series of marco statements that do similar things as the example code below. Sometimes, the macros will cycle through and not change things in the document. Most all the statements do what they are supposed to, but one statement will not. It is not the same statement each time either. Is there something missing in the sample code that would cause it not to do what it should? FYI: This code looks for March dd,yyyy and replaces with March dd, yyyy

Sample Code:

With Selection.Find .Text = “(March[ ^13][0-9]{1,2},)([0-9]{4})”
.Replacement.Text = “\1 \2”
.Forward = True
.wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

This discussion is locked

All Comments