S
Scott Ribe
Assume a template which puts up a custom toolbar for its document. Given two
different documents based on the same template, open at the same time, how
do I either
- have each document own an instance of a toolbar with only the toolbar
instance of the active document displayed at any time, or
- have a single instance of the toolbar, and update some of its controls to
reflect the state of the active document.
I've played around with this, and have found:
- if each document is created from its own (identical) copy of the template,
it just works as I want, but I really can't create a template per document,
- if each document creates its own toolbar, both toolbars are displayed
whenever either document is displayed, even though I attempt to associate
them with their documents as: ActiveDocument.CommandBars.Add,
- I find no mention in the documentation of an Activate event for a window
or document that I could trap in order to adjust the toolbar display
So far, the only thing I've been able to figure out that might work is to
use the Application's OnTime event to continuously check which document is
active.
On the other hand, perhaps a non-modal floating UI is not a practical
possibility and I have to go back to a user form...
different documents based on the same template, open at the same time, how
do I either
- have each document own an instance of a toolbar with only the toolbar
instance of the active document displayed at any time, or
- have a single instance of the toolbar, and update some of its controls to
reflect the state of the active document.
I've played around with this, and have found:
- if each document is created from its own (identical) copy of the template,
it just works as I want, but I really can't create a template per document,
- if each document creates its own toolbar, both toolbars are displayed
whenever either document is displayed, even though I attempt to associate
them with their documents as: ActiveDocument.CommandBars.Add,
- I find no mention in the documentation of an Activate event for a window
or document that I could trap in order to adjust the toolbar display
So far, the only thing I've been able to figure out that might work is to
use the Application's OnTime event to continuously check which document is
active.
On the other hand, perhaps a non-modal floating UI is not a practical
possibility and I have to go back to a user form...