Find Property

Microsoft FrontPage Visual Basic

expression.Find

expression    Required. An expression that returns a SearchInfo object.

Remarks

If the Action property is set to fpSearchFindText or fpSearchReplace text, the Find property defines the text for which to search; if the Action property is set to fpSearchFindTag, then the Find property defines the name of the HTML tag for which to search.

Example

The following example selects the next occurrence of the P element if one is found in the active document.

Dim objSearch As SearchInfo
Dim blnFound As Boolean
Dim objRange As IHTMLTxtRange

Set objSearch = Application.CreateSearchInfo
objSearch.Find = "p"
objSearch.Action = fpSearchFindTag

Set objRange = Application.ActiveDocument.selection.createRange
blnFound = Application.ActiveDocument.Find(objSearch, Nothing, objRange)
If blnFound = True Then objRange.Select