在文档中,如果查找操作向前搜索,则本属性为 True。如果向后搜索,则本属性为 False。Boolean 类型,可读写。
本示例将所选内容中下次出现的“hi”替换为“hello”。
With Selection.Find
.Forward = True
.Text = "hi"
.ClearFormatting
.Replacement.Text = "hello"
.Execute Replace:=wdReplaceOne
End With
下面的示例在文档中向上搜索“Microsoft”。如果找到了,则自动将其选定。
Selection.Collapse Direction:=wdCollapseStart
With Selection.Find
.Forward = False
.ClearFormatting
.MatchWholeWord = True
.MatchCase = False
.Wrap = wdFindContinue
.Execute FindText:="Microsoft"
End With