Dim i As Integer = 2 Dim Found As Boolean = False Do while not session.findById("wnd[0]/usr/lbl[5," & i & "]") is Nothing And Not Found If session.findById("wnd[0]/usr/lbl[5," & i & "]").text = "* All Cost Elements" Then Found = True session.findById("wnd[0]/usr/lbl[5," & i & "]").setFocus session.findById("wnd[0]/usr/lbl[5," & i & "]").caretPosition = 21 session.findById("wnd[0]").sendVKey (2) Else i += 1 End if Loop
But everytime when i run the code ,it will report me "The control could not be found by id." .
------------------------------ Hao Lu ------------------------------