Customizing Tool Bars for One Document

E

e125

I am using Word 2003 and want to remove all tool bars for a particular
document, leaving only the standard bar (i.e., menus such as file, edit,
insert, etc.) . I would like this particular document to open every time with
only the standard tool bar.

Any suggestions will be much appreciated.
 
G

Gordon Bentley-Mix

I suppose you could always write an AutoOpen macro that would cycle through
all of the CommandBar objects in the CommandBars collection and set their
..Visible property to False. Something like the following might work:

Sub AutoOpen()
Dim myCB As CommandBar
' Look at each CommandBar
For Each myCB In ActiveDocument.CommandBars
' Check to see if it's enabled ('cause it doesn't matter if it's not)
If myCB.Enabled = True Then
' Check to see if it's visible (again 'cause it doesn't matter if it's not)
If myCB.Visible = True Then
' Make sure it's not the Menu Bar ('cause that one should still show)
If myCB.Name <> "Menu Bar" Then
' And then hide it
myCB.Visible = False
End If
End If
End If
Next myCB
End Sub

However, because the CommandBars collection is also a child of the
Application object, I'm pretty sure this is going to be a sort of
"psuedo-global" change and not just specific to the one particular document -
at least this is how it appeared to me when I was testing it. Under certain
conditions, after running this code the toolbars are hidden from then on.

In addition, I have PDF Maker installed on this machine, and the PDF Maker
toolbar loads if Word is not running prior to opening the document - most
likely because of the order of execution: the AutoOpen macro runs then the
PDF Maker add-in loads and runs its own code to show its toolbar.

And of course, there's nothing to stop the users from just turning the
toolbars back on again...

This doesn't seem like an especially useful exercise to me. Perhaps if you
told us what the intent is behind your request, we could provide recommend a
better solution?
--
Cheers!
Gordon

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
 
E

e125

Thank you for the email.

The objective of the customization is optimize screen space for a small ms
word window. Using alwaysontopmaker I have a small ms word window open with a
huge file of critical data needing to be inserted in my other document. (The
small window is a quarter of the size of my screen; this size allows me to
work on the main doc simultaneously). I reduce this small ms word window and
extract the data as necessary; then I paste it in. To maximize space on that
small window, I have to close down its numerous tool bars using the customize
option. However, that is tedious, and I plan on using this file and this
configuration for the next 2-3 years. Having to do this each time I work on
this file may needlessly chew up time that could be used for actual work.

Your suggestions would be greatly appreciated.
 
G

Gordon Bentley-Mix

I know this might seem counter-intuitive, but have you thought about another
toolbar? This one would be stored in your "date file" document and would just
have one button that executes a version of the code that I provided
previously - one that's not an AutoOpen macro. This would give you a
single-button that would perform all of those time-consuming toolbar
customisation operations. Of course the risk would remain that the changes
made would then be applied to all document windows opened subsequently.
However, you might be able to overcome this with a bit of clever coding to
record the current state of the toolbars and restore them again later...

If this were my project, I'd look at doing something with a global add-in
that initialised the toolbars when Word was started, and then provided
functionality to toogle the toolbars on an as-needed basis. I'd also include
functionality to allow customisation of the "standard" toolbar set. This way
if you did end up with a situation where all of the toolbars were hidden when
you didn't want them to be, it would be a simple matter to re-display them
again. Unfortunately, I don't have the time to put together any sample code
for doing this as it's a bit more complex than just one short procedure.
However, I would be happy to provide feedback on anything you might develop.
--
Cheers!
Gordon

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
 

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