1
我们如何在一个范围内提取通配符搜索的查找结果?Word VBA通配符搜索匹配
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
上面的代码通过使用< *>作为通配符模式使用范围查找范围内的任何整字。但是我怎样才能得到当前匹配/找到的单词?
这也将工作shakalpesh谢谢你的洞察力。然而,我发现了简单的解决方案。我只需要使用r.text来提取循环中的当前查找结果。希望这可以帮助其他人在范围内的通配符搜索。 ;) – decrementor 2011-04-09 06:28:29