Searches for the specified text, starting from the specified screen location.
expression.SearchText( _
ByVal As String, _
ByVal As Integer, _
ByVal startColumn As Integer, _
ByVal As FindOptions _
) As ScreenPoint object
where
expression is a variable that represents a
Screen Object
Parameters
- text
- Text string to search for.
- startRow
- Starting row for the search. The valid range is 1 through the number of rows.
- startColumn
- Starting column for the search. The valid range is 1 through the number of columns.
- findOption
- A FindOptions enumeration value that specifies the search direction.
Return Value
A
ScreenPoint object that contains the coordinate of the located text or null, if the text is not found.
This sample finds text on the screen and prints the text on that row.
To run this sample in the Reflection demo, create a VT session with the Host IP address set as demo:Unix and log in with any credentials. Then enter "demodata" and run the macro from the screen that contains the "XYZ Company Monthly Sales" table.
Sub FindTextOnScreen()
Dim Point As ScreenPoint
'Get the point on the display on which the data table starts
Set Point = ThisScreen.SearchText("Month ", 1, 1, FindOptions_Forward)
'Increment the row from the header row to first row of data and get the first row
Debug.Print ThisScreen.GetText(Point.Row, Point.Column, ThisScreen.DisplayColumns)
End Sub