Dynamic toolbar?

E

eric

I have a global toolbar with some buttons that should be possible to access
from all docs that I'm working with. However, I also have some specific
templates with their own toolbars. The problem then is that I get two
different new toolbars instead of just one.

I wonder:

1) Is it possible to add buttons to the global toolbar *without* it
affecting new documents based on a new template.

Example:

a) Global toolbar has 2 buttons.
b) I open a new document based on template A. I add 2 buttons *specific* for
template A to Global toolbar. Global toolbar now has 2+2 buttons.
c) I open a new document based in template B. I *don't* want it to show the
Global toolbar with the two extra buttons from template A. Possible?

2) If 1 doesn't work. Can I force the two toolbars to show on the same row
*with the Global toolbar always to the left*? When I try I can put them on
the sam row but with the Global toolbar always to the right = it moves all
the time depening on what template I use = not what I want if there is an
option.

Thanks.

/e
 
J

Jean-Guy Marcil

eric was telling us:
eric nous racontait que :
I have a global toolbar with some buttons that should be possible to
access from all docs that I'm working with. However, I also have some
specific templates with their own toolbars. The problem then is that
I get two different new toolbars instead of just one.

I wonder:

1) Is it possible to add buttons to the global toolbar *without* it
affecting new documents based on a new template.

Example:

a) Global toolbar has 2 buttons.
b) I open a new document based on template A. I add 2 buttons
*specific* for template A to Global toolbar. Global toolbar now has
2+2 buttons. c) I open a new document based in template B. I *don't* want
it to
show the Global toolbar with the two extra buttons from template A.
Possible?

Yes, this can be done.

But, this will require a lot of code and very thorough testing. This is no
beginner project!

First, look here for information on Class Modules and Application Events.
You will need a DocumentChange event:
http://word.mvps.org/faqs/macrosvba/AppClassEvents.htm

Then you will have to write code in the DocumentChange Sub that will
add/hide/remove/unhide buttons on the global toolbar when you
create/close/switch documents..


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top