我想在整个 MSWord 文档中搜索带有通配符的文本并恢复找到的字符串。
类似的东西:
Sub Macro1()
Dim c As Range
Set c = ActiveDocument.Contentsdf
c.Find.ClearFormatting
c.Find.Replacement.ClearFormatting
With c.Find
.Text = "start[abcde]end"
.Replacement.Text = ""
.Forward = True
.wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False '
End With
c.Find.Execute
While c.Find.Found
Debug.Print c.Find.TextFound
c.Find.Execute
Wend
End Sub
但该方法c.Find.TextFound
不存在。有没有办法恢复文本而不重复Selection.Text
?