
Using Execute Method Arguments
The following code uses the Execute(Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%) method of a Find object to search for text within the current selection. Notice that the search criteria, such as searching forward, wrapping, and text to search for, are passed as parameters of the Execute(Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%) method.
To set search options using Execute method arguments
Pass search criteria as parameters of the Execute(Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%) method to search forward through a selection for the text find me.
|
With Application.Selection.Find
.ClearFormatting()
.Execute(FindText:="find me", Forward:=True, Wrap:=Word.WdFindWrap.wdFindContinue)
End With
|
|
object findText = "find me";
object forward = true;
object wrap = Word.WdFindWrap.wdFindContinue;
Application.Selection.Find.ClearFormatting();
Application.Selection.Find.Execute(
ref findText, ref missing, ref missing, ref missing, ref missing,
ref missing, ref forward, ref wrap, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing);
|