I want to search an entire MSWord document for a text with wildcards and recover the strings found.
something like that:
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
but the method c.Find.TextFound
does not exists. Is there any way to recover the text without recurring to Selection.Text
?