SearchText4 Method (IbmScreen)
Searches the specified text, starting from the specified screen location and ending at the specified end screen location.
Parameters
- text
- The specified text string.
- startRow
- Start row.
- startColumn
- Start column.
- endRow
- End row.
- endColumn
- End column.
- findOption
- A FindOption enumeration that specifies the search direction.
- textComparison
- A TextComparisonOption Enumeration that indicates how text is compared against the text on the host screen.
Return Value
A
ScreenPoint object object that contains the screen coordinate where the specified text begins, if found, or null if the text could not be found.
This sample performs a case sensitive search for the "PDF" string on a screen and returns the column and row of the string if it is found. It also searches for a lowercase "pdf" string.
Sub SearchForCaseSensitiveText()
Dim screenPosition As Attachmate_Reflection_Objects_Emulation_IbmHosts.ScreenPoint
Dim lowerCaseText As String
Dim upperCaseText As String
lowerCaseText = "pdf"
upperCaseText = "PDF"
'look for uppercase text
Set screenPosition = ThisIbmScreen.SearchText4(upperCaseText, 1, 1, 23, 52, FindOption_Forward, TextComparisonOption_MatchCase)
If IsEmpty(screenPosition) Or (screenPosition Is Nothing) Then
MsgBox upperCaseText & " Not found"
Else
MsgBox upperCaseText & " found at row " & screenPosition.row & " and column " & screenPosition.column
End If
'Look for lowercase text
Set screenPosition = ThisIbmScreen.SearchText4(lowerCaseText, 1, 1, 23, 52, FindOption_Forward, TextComparisonOption_MatchCase)
If IsEmpty(screenPosition) Or (screenPosition Is Nothing) Then
MsgBox lowerCaseText & " Not found"
Else
MsgBox lowerCaseText & "found at row " & screenPosition.row & " and column " & screenPosition.column
End If
End Sub