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