How can we extract the find result for a wildcard search in a range?
dim r as range
set r = activedocument.range
Do While r.Find.Execute(findtext:="<*>", MatchWildcards:=True) = True
Msgbox <Show the matching word it found here>
if **<the word it matched>** = "Stop" then do something here
Loop
The above code uses range to find any whole word in a range by using <*> as the wildcard pattern. But how can i get the current match/word it found?
EDIT: I am not too familiar with word object model. The
Findmethod works onRangebut I don’t know, how to find the text it could find. The above code is modified after running a macro, to see what output does find produce.Hope that helps.