InfoConnect for Airlines VBA Guide
ExtendSelectionRect Method (IbmScreen)
The row in which the selection ends.
The column in which the selection ends.
Selects a block of text in the terminal window that includes all rows between the starting row and the specified row.
Syntax
object.ExtendSelectionRect( _
   ByVal row As Long, _
   ByVal column As Long _
) 

Parameters

row
The row in which the selection ends.
column
The column in which the selection ends.
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeException This exception is thrown if the row or column parameters are outside the range of valid values: (1 to Rows) or (1 to Columns).
Remarks

Use the SetSelectionStartPos method to set the starting coordinates. (The default starting position is row 1, column 1.)

The ExtendSelectionRect method returns a rectangular block of text between the starting and ending row. The starting and the ending coordinate columns define the vertical edges of the block. The resulting block of text is shaped like this:

xxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxx

The ExtendSelection method selects the stream from the starting position coordinate to the extended position coordinate and returns a text selection shaped like this:

xxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxx

If the ending coordinates are smaller than the starting coordinates, the ExtendSelectionRect and ExtendSelection methods select text backwards (from right to left or bottom to top).

These methods select text but do not return the selected area. To get the selected region and its properties, use the ScreenRegion object.

Example
This sample selects a block of text when the screen is ready. It also gets the selected screen region.
Private Sub IbmScreen_NewScreenReady(ByVal sender As Variant)
    
    Dim screenRegionIbm As ScreenRegion
    
    'Select the text area
    ThisIbmScreen.SetSelectionStartPos 5, 5
    ThisIbmScreen.ExtendSelectionRect 21, 21
    
    'Get the selected screen region
    Set screenRegionIbm = ThisIbmScreen.selection
    MsgBox ("Start Row = " & screenRegionIbm.StartRow & ", End Column = " & screenRegionIbm.EndColumn)
 
End Sub
See Also