D
David Yeager
I have a somewhat difficult to explain problem:
I'm trying to find all instances of a certain string
through VBA, but the Find method doesn't seem to work
quite the same way in VBA as it does in Word itself.
Basically, I'm looking for instances of an old tag used in
old text files. Let me post the code:
With Selection.Find
.ClearFormatting
.MatchWildcards = True
.Text = "\{headbi\}*[{<]"
Do While intHeadBiLoopCounter <> 0
.Execute
strHeadBiArray(intHeadBiLoopCounter) =
Selection.Text
Debug.Print strHeadBiArray
(intHeadBiLoopCounter)
intHeadBiLoopCounter = intHeadBiLoopCounter - 1
Debug.Print intHeadBiLoopCounter
Loop
End With
The problem here is that the code only hits EVERY OTHER
instance of {headbi}*[{<]... for some reason it skips over
the next {headbi} after finding one. Anybody have any
idea what I'm doing wrong?
-Dave
I'm trying to find all instances of a certain string
through VBA, but the Find method doesn't seem to work
quite the same way in VBA as it does in Word itself.
Basically, I'm looking for instances of an old tag used in
old text files. Let me post the code:
With Selection.Find
.ClearFormatting
.MatchWildcards = True
.Text = "\{headbi\}*[{<]"
Do While intHeadBiLoopCounter <> 0
.Execute
strHeadBiArray(intHeadBiLoopCounter) =
Selection.Text
Debug.Print strHeadBiArray
(intHeadBiLoopCounter)
intHeadBiLoopCounter = intHeadBiLoopCounter - 1
Debug.Print intHeadBiLoopCounter
Loop
End With
The problem here is that the code only hits EVERY OTHER
instance of {headbi}*[{<]... for some reason it skips over
the next {headbi} after finding one. Anybody have any
idea what I'm doing wrong?
-Dave