Find.Wrap 属性 (Word)Find.Wrap property (Word)

返回或设置如果搜索开始于文档的开头的点,达到文档的末尾 (反之亦然如果Forward设置为False) 会发生什么情况,或者如果搜索文本未找到指定的选定内容或区域中。Returns or sets what happens if the search begins at a point other than the beginning of the document and the end of the document is reached (or vice versa if Forward is set to False) or if the search text isn't found in the specified selection or range. 读/写 WdFindWrapRead/write WdFindWrap.


expressionexpression. Wrap

expression:必需。expression Required. 代表查找对象的变量。A variable that represents a 'Find' object.


以下示例在文档中向前搜索单词"aspirin"。The following example searches forward through the document for the word "aspirin." 到达文档末尾时,继续从文档开头进行搜索。When the end of the document is reached, the search continues at the beginning of the document. 如果找到单词"aspirin",则选中该单词。If the word "aspirin" is found, it is selected.

Sub WordFind() 
 With Selection.Find 
 .Forward = True 
 .MatchWholeWord = True 
 .MatchCase = False 
 .Wrap = wdFindContinue 
 .Execute FindText:="aspirin" 
 End With 
End Sub

另请参阅See also

查找对象Find Object