To find the phrase .co.uk in a Text object named Emails starting from the beginning of the text to the index position 15, use the following syntax:
Emails.SetSelection(0,15);
foundText = Emails.FindTextInSelection(".co.uk",0);
if (foundText == -1)
{
Debug.trace("No occurrences of '.co.uk' found!");
}
else
{
// other statements here
}
Note:
In the example above, the if statement will only run when the phrase .co.uk is not found. If the phrase is found, the lines of code in the else section will be run.
see also:FindText example