Jump to content
Sign in to follow this  

Waiting for Button to Become Enabled

Recommended Posts


I have a situation where my Merchant Services Program sends an email to each of my vendors at the end of the business day each day. I have 37 emails that go out each evening. The problem is that Microsoft Outlook catches the program, forces me to wait until the activity bar is full before it enables the [Allow] button. I've done a fairly simple script  to wait for the window then click Button4, but I suspect it is clicking the button before it is enabled and thus not doing anything. Question 1: How do I get AutoIt to wait until Button4 is enabled? Question 2: How do I make the script persistent so it selects the Allow button each of the 37 times it gets displayed each evening?


Share this post

Link to post
Share on other sites


Hi and welcome to the forum...

You may not need to interact with Outlook at all.  See >this thread.  If you have questions  please remember to define exactly what you tried and what happened or did not happen as expected.  Post code to demonstrate your problem whenever possible.

If you do not understand the code that I am pointing you to, please take a look at the Help file.

Good Luck,


edit: The outlook dialog box can be interacted with but the code from the link is a much cleaner way, in my opinion.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post

Link to post
Share on other sites

If you end up having to interact with the Outlook dialog box, perhaps code like this will work for you

ControlClick("Forum Spam List Checker", "", "Button5") ;Submit button
Until ControlCommand("Forum Spam List Checker", "", "Button5", "IsEnabled") ;Wait until button becomes enabled

Note the use of the ControlCommand function, and that you will have to use the Window Info Tool in order to get the proper window title and button ID to use.

Another welcome to this great forum! And remember, the Help file is your friend, and will probably become one of your best friends!!

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.