R
Roderick O'Regan
I'm using Word 2007 with Vista.
I've created a template which, when run, allows the use, through a
userform,r to set the left margins either to 2cm ("Narrow") or 7cm
("Wide").
The user has created two documents based on the above template and
which are open on their desktop. One has wide margins and the other
narrow ones based on the settings above.
In the template VBA Editor under "This Document" folder I've created a
macro when run checks the value of the margins for the active document
and tells the user via a msgBox whether it is "Wide" or "Narrow".
This works OK for the two open documents but on a manual basis only.
What I now want to do is automate this so that when the user changes
focus from one document to another it automatically runs the macro
which tells them whether they are working in the document with either
wide or narrow margins set.
I've been trying to see if there is anything to be found on
automatically updating macros or even the SetFocus command but to no
avail. I suspect I'm not using the correct keywords!
Is my automation request possible, please?
I've created a template which, when run, allows the use, through a
userform,r to set the left margins either to 2cm ("Narrow") or 7cm
("Wide").
The user has created two documents based on the above template and
which are open on their desktop. One has wide margins and the other
narrow ones based on the settings above.
In the template VBA Editor under "This Document" folder I've created a
macro when run checks the value of the margins for the active document
and tells the user via a msgBox whether it is "Wide" or "Narrow".
This works OK for the two open documents but on a manual basis only.
What I now want to do is automate this so that when the user changes
focus from one document to another it automatically runs the macro
which tells them whether they are working in the document with either
wide or narrow margins set.
I've been trying to see if there is anything to be found on
automatically updating macros or even the SetFocus command but to no
avail. I suspect I'm not using the correct keywords!
Is my automation request possible, please?