Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / SelectText Method
Beginning row of text selection.
Beginning column of text selection.
Ending row of text selection. The valid range is 1 through the number of rows.
Ending column of text selection. The valid range is 1 through the number of columns.
A RegionOption value that specifies a wrapped or rectangular region.
Example
In This Topic
    SelectText Method
    In This Topic
    Selects specified display memory text.
    Syntax
    expression.SelectText( _
       ByVal startRow As Integer, _
       ByVal startColumn As Integer, _
       ByVal endRow As Integer, _
       ByVal endColumn As Integer, _
       ByVal region As RegionOption _
    ) As ReturnCode
    where expression is a variable that represents a Screen Object

    Parameters

    startRow
    Beginning row of text selection.
    startColumn
    Beginning column of text selection.
    endRow
    Ending row of text selection. The valid range is 1 through the number of rows.
    endColumn
    Ending column of text selection. The valid range is 1 through the number of columns.
    region
    A RegionOption value that specifies a wrapped or rectangular region.

    Return Value

    One of the following ReturnCode enumeration values.

    Member Description
    Cancelled Cancelled.
    Error Error.
    PermissionRequired Permission is required.
    Success Success.
    Timeout Timeout condition.
    Truncated The text is truncated.

    Example
    'This example selects a rectangular area on the screen and copies the selection to the clipboard
    Sub SelectTextAndCopy()
     
        Dim rcode As ReturnCode
        Dim StartSel As ScreenPoint
        Dim EndColPoint As ScreenPoint
        Dim EndCol As Integer
        Dim EndRowPoint As ScreenPoint
        Dim EndRow As Integer
        Dim EndSel As ScreenPoint
        
       'Get the last column in the table
        Set EndColPoint = ThisScreen.SearchText4("Profit", 1, 1, ThisScreen.DisplayRows, ThisScreen.DisplayColumns, FindOptions_Forward, TextComparisonOption_IgnoreCase)
        EndCol = EndColPoint.column + Len("Profit")
     
        'Get the last row in the table
        Set EndRowPoint = ThisScreen.SearchText4("Dec", 1, 1, ThisScreen.DisplayRows, ThisScreen.DisplayColumns, FindOptions_Forward, TextComparisonOption_IgnoreCase)
        EndRow = EndRowPoint.row
     
        'Select a rectanglular area defined by the first row and column and the last row and column
        rcode = ThisScreen.SelectText(1, 1, EndRow, EndCol, RegionOption_Rectangular)
        
        'Copy the selection to the clipboard
        rcode = ThisScreen.Copy2(CopySourceOption_Selection)
        
    End Sub
    See Also