Discussion Locked

Word Macro not changing data

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

3 replies

by dakota99

Thanks so much for the information. The site you listed is full of useful information. Thanks Again

This discussion is closed to new replies.