10-15-2009, 08:45 PM
The only way I have found to do this is select the item and trap the error that is returned if it's missing. It's a little messy, but it works...hopefully. I haven't had a reason to try this in an actual script, just tried a few things after reading your post.
Another option might be to see if the window exist instead of the Err.Number. if the expected window does not exist then select the other menu option. Either way you have to bypass the error handler to continue.
GL.
Code:
on error resume next 'disable error trap
VbWindow("APP").WinMenu("Menu").Select("Tools;Loop Options...")
if Err.Number <> 0 then
VbWindow("APP").WinMenu("Menu").Select("Tools;XML Loop Options...")
end if
on error goto 0 'reset error trapping
Another option might be to see if the window exist instead of the Err.Number. if the expected window does not exist then select the other menu option. Either way you have to bypass the error handler to continue.
GL.