TX Text Control ActiveX Documentation

TXTextControl.Find Method

Searches the text in a Text Control for a given string.

Syntax

TXTextControl.Find FindWhat[, Start[, Options]]
ParameterDescription
FindWhat

Specifies the string to search for.

Start

Optional. An integer character index that determines where to begin the search. The first character of text in the control has an index of 0. When this parameter is omitted or set to -1, the search begins at the current input position.

Options

Optional. Is the sum of one or more constants used to specify optional features, as described in the following list:


ConstantDescription
1 - SearchUpDetermines the direction of searches through a document. If this flag is used, the search direction is up; if the flag is not used, the search direction is down.
4 - MatchCaseDetermines if a match is based on the case of the specified string as well as the text of the string.
8 - NoHighLightDetermines if a match appears highlighted in the Text Control.
16 - NoMessageBoxSuppresses the built-in message boxes which inform the user that a match could not be found.

Return Value

If the text searched for is found, the Find method highlights the specified text and returns the index (zero-based) of the first character highlighted. If the specified text is not found, the Find method returns -1.

Data Types

FindWhat:String
Start:Long
Options:Long
Return value:Long

See Also

 
 
User Contributed Note

User Contributed Note by Joe Vignando on August 12, 2010 at 4:01:09 PM CEST

With regards to search/replace functionality. Can the search/replace do it quietly without user intervention? Example I had a document where I want to change the string 'Company Name' to 'My Company', without any user intervention. Much like a form letter where I just want to change a string. Not tied to a database Thanks
User Contributed Note

User Contributed Note by Björn Meyer on August 12, 2010 at 4:05:58 PM CEST

Not a problem. Just call the Find method with the parameter "NoMessageBox". The text will be selected automatically. Using Selection.Text, you can replace the text. No user interaction required.
 

Products

Support

Downloads

Corporate

Buy Now