find2
Find a text string.
find2([in] BSTR text, [in] LONG flags, [out, retval] VARIANT_BOOL *found)
This function searches the current PDF file for a given text string.
It is a more powerful version of
find
and findNext
, adding the
ability to search backward, as well as case-sensitive searching.
find2
returns a boolean, indicating whether the search
string was found.
The flags
argument contains zero or more of the following
flags (or'ed together):
find2Backward
: search backward from the starting point; if there is a selection, the search starts immediately before it, otherwise the search starts at the bottom of the current pagefind2CaseSensitive
: perform a case-sensitive search (the default is case-insensitive)find2Next
: start searching from the previous search result (instead of the current selection or top/bottom of page)find2OnePageOnly
: search only the current page (normally searches continue on subsequent pages)find2WholeWord
: limit searches to whole words
viewer.find2Backward
, etc.
VB:
' do a backward, case-sensitive search
viewer.find2("Needle", viewer.find2Backward Or viewer.find2CaseSensitive)