Catching menu item click event

J

Jill

I am coding an Outlook addin using Visual Basic and CDO. In my addin,
I have added several items to the "Tools" menu. One of these menu
items starts a process that can take several minutes to complete. A
second menu item becomes enabled only when this process is running, and
this second menu item is used to stop the process started by the first
menu item.

I am able to catch the menu button click event and start the process
with no proplems. I have added a DoEvents call into the main loop of
my proccess to allow events to be handled while the process is still
running. I am able to catch serveral types of events while the process
is running. However, I cannot catch another menu button click event
while the process is still running, i.e. while the first menu button
click is still being handled.

Any ideas why i am unable to catch the second menu button click event?
An ideas how to fix/circumvent this issue?

Thanks!
 
K

Ken Slovak - [MVP - Outlook]

Use a timer control to start up your long running process. Set the timer
control to ON when the first click event fires. The timer will fire after
that and start your process, which will allow the first Click event
procedure to complete before the process starts and therefore your second
click will fire.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top