Hi everyone,
I am not the most VB savvy, but I am trying to learn this for making some macros for my job.
I have a huge word doc full of statements and am trying to search through the document, find specific criteria, copy the entire page to a new document, and move on to the next
found item.
It works but it stops after the first found item. I have tried it with if .Forward = true, is there are better way to do this?
Selection.GoTo What:=wdGoToBookmark, Name:="\page"
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Page 1 of 2"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
If .Found = True Then
Selection.Cut
docB.Activate
Selection.Paste
docA.Activate
End If
End With
Does anything look amiss? Any help is greatly appreciated!


Reply With Quote
