Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / SearchText4 Method
The text string to search for.
Starting row for the search. The valid range is 1 through the number of rows.
Starting column for the search. The valid range is 1 through the number of columns.
Ending row for the search.
Ending column for the search.
A FindOptions value that specifies the search direction.
A TextComparisonOption value that specifies the role of letter case in the search.
Example
In This Topic
    SearchText4 Method (Screen)
    In This Topic
    Searches for the specified text on the screen, from the specified starting location and to the specified ending location.
    Syntax
    expression.SearchText4( _
       ByVal text As String, _
       ByVal startRow As Integer, _
       ByVal startColumn As Integer, _
       ByVal endRow As Integer, _
       ByVal endColumn As Integer, _
       ByVal findOption As FindOptions, _
       ByVal textComparison As TextComparisonOption _
    ) As ScreenPoint object 
    where expression is a variable that represents a Screen Object

    Parameters

    text
    The 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.
    endRow
    Ending row for the search.
    endColumn
    Ending column for the search.
    findOption
    A FindOptions value that specifies the search direction.
    textComparison
    A TextComparisonOption value that specifies the role of letter case in the search.

    Return Value

    A ScreenPoint object that contains the coordinate of the located text or null, if the text is not found.
    Example

    This example finds the position (row and column) of a string on a screen.

    To run this sample, create a VT session with the host name/IP address set to demo:unix.
    Then enter any text for credentials and enter demodata to navigate to the XYZ Company Sales screen.

    Enter and run this code in a code module.

    'This example finds the position (row and column) of a string on a screen
    Sub ExampleForSearchText4()
     
        Dim sPoint As ScreenPoint
        Dim text As String
        Dim row, column As Integer
        
        'Get the maximum rows for the screen
        row = ThisScreen.DisplayRows
        column = ThisScreen.DisplayColumns
        
        'Find the row
        Set sPoint = ThisScreen.SearchText4("Profit", 1, 1, row, column, FindOptions_Forward, TextComparisonOption_IgnoreCase)
        
        'Get the Text
        text = ThisScreen.GetText(sPoint.row, sPoint.column, 8)
        
        Debug.Print text; " is at row " & sPoint.row & " and column " & sPoint.column
        
    End Sub
    See Also