Adding a permanent Toolbar to Word

F

Fiance

Hello,

I can't find a way to satisfy this one preference of mine: how do I
make the Outlining toolbar visible all the time? Now, when I close
Word, it just disappears and I have to show it every time. No options
in the Customize menu or Tools...

In addition, is there a way to permanently avoid the Update TOC dialog
("update all table" or "update page numbers only")? I need "update all
table" always.

Thanks!
 
S

Stefan Blom

In Word 2003 (and perhaps also in Word 2002) you should be able to use the
following auto macros:

Sub AutoNew()
CommandBars("Outlining").Visible = True
End Sub

Sub AutoOpen()
CommandBars("Outlining").Visible = True
End Sub

in normal.dot to display the toolbar at all times.

For assistance, see http://www.gmayor.com/installing_macro.htm.

Note that you won't see all buttons if you are not in Outline view. Also
note that the macro may not work if used in Word 97 or 2000; see this
thread:

Outline toolbar
http://groups.google.se/group/micro...anagement/browse_frm/thread/3c4e45e5296a8085/
 
S

Stefan Blom

To update the TOCs of a document, you can also use a macro:

Sub UpdateTheTOC()
Dim i As Integer
Dim toc As TableOfContents
For i=1 to 2
For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next toc
Next i
End Sub

The outer loop was added just in case the first update inserts an extra page
(for the TOC) and potentially causes the page numbering to be wrong; it may
not be needed with recent versions of Word.

Assign a keyboard shortcut or add it to a toolbar. See
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
G

Graham Mayor

You can do both with vba

For the outlining toolbar - add

CommandBars("Outlining").Visible = True

to each of an autoopen and an autonew macro in normal.dot and the bar will
be open for each new and opened document.

To update the TOC - use the following macro (replace the tool on the
outlining toolbar with this macro)

Sub UpdateAllTOC()
Dim oTOC As TableOfContents
For Each oTOC In ActiveDocument.TablesOfContents
oTOC.Update
Next oTOC
End Sub

or simply update all the fields using the code at
http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
F

Fiance

or simply update all the fields using the code athttp://www.gmayor.com/installing_macro.htm


Thanks for the macros. However, after 10 minutes of trying to follow
the Idiot's Guide to Macros, I failed :/

If I create a new macro ("AutoOpen") in the Alt+F8 Window, save it,
then try to create the next one ("AutoNew"), the former is overwritten
- regardless of the fact that I typed in the unique name and confirmed
that I do not want to overwrite.

When I type in the unique name ("AutoNew"), and hit Create,

Sub AutoNew()
'
' AutoNew Macro
' Macro created 9/7/2007 by a
'

End Sub


ends up appended to the end of the AutoOpen macro in the VB window. If
I save, I still have one macro, not two.
 
G

Graham Mayor

Assuming that you haven't got an existing autoopen or autonew macro that you
want to keep, simply select the unwanted bits that you have just created and
paste the following over to replace them. This essentially a text file and
can be treated in the say way as editing text.

Sub AutoNew()
CommandBars("Outlining").Visible = True
End Sub

Sub AutoOpen()
CommandBars("Outlining").Visible = True
End Sub

Sub UpdateAllTOC()
Dim oTOC As TableOfContents
For Each oTOC In ActiveDocument.TablesOfContents
oTOC.Update
Next oTOC
End Sub

which will give you the three macros.

Add to or replace the update TOC command on the outlining toolbar with the
new update macro. Then save normal.dot

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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