Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word event onfocus/activate

Status
Not open for further replies.

BrianWen

Programmer
Jun 8, 2009
102
DK
Can it really be true, that there is no way to catch whenever a certain already opened document gets focus/is activated?
I want to run a small bit of code whenever certain documents gets focus.
 
Look at the Application.WindowActivate event.

Code:
Private Sub object_WindowActivate(ByVal Doc As Word.Document, ByVal Wn As Word.Window)

then you can check for Doc.name or whatever you need to identify it
 
Sounds very much like something I could use. Having juggled around with it a while, I cannot figure out where/how to put this in work.

Could you point me a little more in the right direction?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top