OK, This is the dialog window using Spy++:
I used this test code to try to select the options, and close the window, but for some reason, it does not press the "Yes" button...
VB Code:
Private Sub Form_Load() 'StartEnumWindows tmrCheckOutlook.Interval = 150 tmrCheckOutlook.Enabled = True End Sub Private Sub tmrCheckOutlook_Timer() Dim hWnd As Long, Count As Long hWnd = FindWindow("#32770", "Microsoft Outlook") If hWnd <> -1 And hWnd <> 0 Then 'StartEnumChildWindows hWnd BringWindowToTop hWnd SetForegroundWindow hWnd Pause 150 SendKeys "{TAB 2}", True SendKeys " ", True SendKeys "{TAB}", True SendKeys "{DOWN 3}", True SendKeys "{TAB}", True SendKeys "{ENTER}", True ' < ---- this does not work !!! SendKeys " ", True ' < ---- pressing the space key does not work either... Debug.Print "tmrCheckOutlook_Timer" tmrCheckOutlook.Enabled = False End If End Sub Private Sub Pause(ByVal Delay As Long) Dim EndTime As Long EndTime = GetTickCount + Delay Do Sleep 10 DoEvents Loop Until GetTickCount >= EndTime End Sub




Reply With Quote