Retrieves text from the specified screen region.
Parameters
- startRow
- The starting row position.
- startColumn
- The starting column position.
- endRow
- The ending row position.
- endColumn
- The ending column position.
- regionOption
- A RegionOption enumeration value that specifies how the region is interpreted.
- translationOption
- A TextTranslationOption enumeration value that specifies how or whether screen data is translated.
Return Value
The screen text from the specified region.
This sample gets data on the screen and prints it as XML. To run this sample, Create an open systems session and set the host name IP/Address to Demo:UNIX. Then enter any credentials to log in and at the "demo:" prompt, enter "demodata". Run the macro on the screen that has the "Command" prompt.
Sub getTextFromScreenAsXml()
Dim maxRow As Integer
Dim maxCol As Integer
Dim startPoint As ScreenPoint
Dim startRow As Integer
Dim text As String
maxRow = ThisScreen.DisplayRows
maxCol = ThisScreen.DisplayColumns
Set startPoint = ThisScreen.SearchText("Month ", 1, 1, FindOptions_Forward)
startRow = startPoint.Row
'Get all the text on the screen from the top row to the last row and column
text = ThisScreen.GetText3(startPoint.Row, 1, maxRow, maxCol, RegionOption_Rectangular, TextTranslationOption_AsXML)
'print xml to Intermediate window
Debug.Print text
End Sub