FocusWindowContaining Example

 

Option Explicit

Sub Main

Dim intReturn As Integer

 

Dim varWindowTitle As Variant

Dim intExactTitleMatch As Integer

Dim varTextToFind As Variant

Dim intExactTextMatch As Integer

 

 varWindowTitle = "This is the window title to look for"

 intExactTitleMatch = 0

 varTextToFind = "This is the text on the dialog window to look for"

 intExactTextMatch = 1

 

 intReturn = Action2.FocusWindowContaining(varWindowTitle, intExactTitleMatch, varTextToFind, intExactTextMatch)

 

 If intReturn = 0 Then

  MsgBox "Failure"

  MsgBox( Action2.GetLastError )

 ElseIf intReturn = 1 Then

  MsgBox "Success"

 End If

 

End Sub