Firstly, thank you for providing this excellent method of communicating issues and solutions between users. I have found a great deal of assistance in here well before I joined the forum.
However, I have been through many of the posts in this forum and thought I had found the answer to my question posted by Bob Hansen but I simply could not get it to work although, apparently, the original poster was able to do so.
I am running MS V6.0.0.14 (on WinXP SP2) as this is the latest available registered copy from my employer.
I simply cannot get the logic to work when I check for the presence of a window.
The code I'm using is as follows (as suggested by Bob Hansen):
When I try to run this with no window open (because that's when I need to change what I'm doing), I get an error message to say the specified window could not be found. I know this. What I need is the ability to continue with other instructions if there is no window.IfWindowOpen>MyWindow*,Continue,End
Label>Continue
SetFocus>MyWindow*
...
Do stuff
...
Label>End
The reason for this is that the rest of the code I have is processing an unknown number of email messages several times a day. They are opened, a further action is made, they are moved to a different folder, closed, then the steps are repeated. Eventually, I get to the end in each scheduled run. So, if the message window is not present, I want the macro to end. Currently, I get the error message and my workaround is to have a another macro triggered by a windowevent to Abort the error, thus ending the macro but this is really ugly and should not be necessary.
I would greatly appreciate any assistance, bearing in mind that I only started playing with MS a few weeks ago and have absolutely NO experience in programming.
Thanking you in advance ...
J.