FindTextInSelection()

Syntax:

textObject.FindTextInSelection( String, StartPosition, CaseSensitive )

Return:

The Index position of the first character in the parameter String if it is found and the value -1 if it is not found.

Parameters:

String - a string to find within a Text object. String can be any string surrounded by quote marks or a variable name containing a string. This pararemeter is required.

StartPosition – the Index position to start the search at. StartPosition is a zero-based index. This parameter is optional and the default is to start at index number 0.

CaseSensitive – sets whether the search will take account of the case of the text to match uppercase and lowercase. The options are true or false. This parameter is optional and the default is false.

Remarks:

This function allows you to find a character, word or phrase within a Text object. This function will only search for the parameter String in the selected text of a Text object, the rest of the text is ignored – see SetSelection for more information on selecting text. If used with a while loop you can find the number of occurrences of the string within the text.

Note:
If no text is selected, this function will search through all of the text in the specified Text object.

image\Script_Button.jpgExamples