I'm converting some mainframe VBscript macros to VBA and can't seem to figure a piece out.
In VBScript I use the EMWaitText where I look for a string anywhere on the screen to get it's X coordinate. The Y coordinate is always a constant.
EMWaitText .15,strTextLoc,1,1,intRowResult, intColResult
If intColResult >0 Then
strTextLoc = intRowResult
End If
I have a function (below) to wait for a string when I know the X,Y coordinates it should be at but can't seem to modify it accomodate what I need above.
Public Sub WaitText(ctl As Control, strText As String, lngX As Long, lngY As Long, Optional blnDoEnter As Boolean = False)
Dim strRetVal As String
ctl.GetScreen strRetVal, lngX, lngY, Len(strText)
Do Until strRetVal = strText
ctl.GetScreen strRetVal, lngX, lngY, Len(strText)
DoEvents
If blnDoEnter = True Then
DoEnter (ctrl)
End If
Loop
End Sub
Any assistance is appreciated.
In VBScript I use the EMWaitText where I look for a string anywhere on the screen to get it's X coordinate. The Y coordinate is always a constant.
EMWaitText .15,strTextLoc,1,1,intRowResult, intColResult
If intColResult >0 Then
strTextLoc = intRowResult
End If
I have a function (below) to wait for a string when I know the X,Y coordinates it should be at but can't seem to modify it accomodate what I need above.
Public Sub WaitText(ctl As Control, strText As String, lngX As Long, lngY As Long, Optional blnDoEnter As Boolean = False)
Dim strRetVal As String
ctl.GetScreen strRetVal, lngX, lngY, Len(strText)
Do Until strRetVal = strText
ctl.GetScreen strRetVal, lngX, lngY, Len(strText)
DoEvents
If blnDoEnter = True Then
DoEnter (ctrl)
End If
Loop
End Sub
Any assistance is appreciated.