![]() |
|
|
|
#1
|
|||
|
|||
|
This was really useful, thank you.
I would like to know if there is a similar method for running a macro when a Document is activated or re-activated (rather than when the Word Application window itself is activated). Is there any way of doing that? What I'm hoping for is something that works similarly to Private Sub Worksheet_Activate() for a sheet in an Excel workbook, so that the macro fires when a Word document is activated or re-activated while the Word Application remains running. With thanks in anticipation... |
|
#2
|
|||
|
|||
|
If I'm understanding you correctly, it seems it would work if you use the "DocumentChange" procedure (in that second step) rather than WindowActivate. So the sub (in the class module) looks like this:
Private Sub App_DocumentChange() MsgBox "changed!" End Sub Everything else remains the same. This fires the sub every time you switch from one doc to another without leaving Word. |
|
| Tags |
| activate |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| This copy of MS Office not activated | chzuck | Office | 1 | 10-10-2021 03:10 PM |
| I clicked "this document" in VBA thinking it was a menu button, it said "saving", how can I reverse | messgchr | Word VBA | 2 | 07-20-2020 06:52 PM |
| Is my Office 'activated' or not? | mabel | Office | 6 | 08-01-2019 04:18 AM |
Retrieve the last activated document name.
|
eduzs | Word VBA | 1 | 08-22-2017 03:11 PM |
| Hyperlink not activated by footpedal | Donone | PowerPoint | 2 | 05-05-2014 04:42 AM |