patgenn123
Nov 18 2009, 09:24 PM
Is there a way to trigger a macro when I click on a control?
The reason I ask such a simple yet idiotic question is because the Activation Tab gives us only two choices:
1)Control on Top
2) Control Focused
Well, neither one works. It keeps on triggering the macro when the larger control is visible and I only want the control to be triggered ONLY WHEN I click on a certain button on the larger control. The larger control is a form and the button(which is subcontrol of the larger control(the form) is what I want to trigger the rest of the macro.
I have tried different things like the larger control as the trigger, but nothing seems to work. It just triggers it when the control is visible. I don't want that. I want the macro to trigger only when I click the button.
This is a dunce question, but certainly would like some help.
Thanks all!
Pat
JohnS
Nov 26 2009, 02:20 AM
There could be two ways of tackling the problem. One is to activate the macro when needed. The other is to have a macro already running and monitoring for a specific mouse click on the button to proceed. Instead of using controls you could alternatively use a mouse event (eg click) in either of these scenarios, with suitable logic to identify that the button area in the correct window has been pressed. A solution will have to take into account what else you are doing with the windows/pc and what effect pressing the button may have.
Yet another method would be to have a hotkey that starts the macro, giving a mouse left click on the button followed by the rest of the macro main action.
I don't use controls very much so I'll leave that area to someone more experienced.
edit: mouse right changed to mouse left