>I use VFP REPORT command to create reports in Web server.
>However, if there is an error in report, VFP displays
>modal centered error messagebox having OK and HELP buttons.
>This box which cannot be captured by ON ERROR.
>
>Is it possible to use your code to Click the OK button in this messagebox ?
I doubt it will work in that situation, but you could always try it. The problem comes with knowing the exact text in the Window title (an inexact name can be used, but the results are unpredictable, since the first Window encountered matching as well as another window will be taken as the app window by AppActivate(). In addition, the timing of the delay needs to be predictable; firing AppActivate() and SendKeys() too early may cause the app to eat the keystroke.