Run Code when document is Activated? Or clicked anywhere in it?
Is there a way to have a word document run a vba function whenever it's activated--and by activated, I mean--the document is already open, but the user has switched to another application then switched back to the document.
Alternatively, any method to run the vba code when, in switching back to word, the document is clicked on (anywhere in the document--not a specific button or text)?
The usage case here is -- user has opened word doc, switched to another application and possibly put some text from it in the Windows clipboard. As soon as they switch back to word (and the already open doc) I have code that will check the clipboard for specific strings and do some stuff if it sees those strings. The user could be anywhere in the document and this needs to be transparent to the user and require no extra clicks--meaning they won't be able to go find a macro button and then click it to activate this clipboard check.
I know I could run it on open, but is there any way to do it on "activate" like Excel has when a sheet is made active?
|