How to Update Entire TOC Always?

J

Jayawanth

When updating TOC with F9, Word prompts with
"update only page numbers" or "Entire Table" .
Can I skip this dialog and update entire table by assigning a key to some
command?

I tried assigning key to UpdateTocFull but there is no response when I press
the hot-key (Alt+U is what I tried)

The command with Toc in it seem to be these three. Any other command I am
missing?

UpdateTableOfContents
UpdateToc
UpdateTocFull

Thanks in advance.
Jayawanth
 
J

Jayawanth

I am trying to show messages like "Updating #n of m TOCs" in the status bar
but each time it gets overwritten by words section, page etc.

Can we use the unused part of the StatusBar for displaying status messages?
Or perhaps MessageBox where we update the message and eventually pull it
down after the last message and the user OKs it?
 
S

Stefan Blom

I have to admit I don't know how (or even if) you can access the status bar
via a VBA macro. Ask in a programming newsgroup such as
microsoft.public.word.vba.general.

A simple message box could be displayed, of course, but that would probably
just annoy users:

Sub UpdateAllTOCs()
counter = ActiveDocument.TablesOfContents.Count
For i=1 to counter
MsgBox "Updating TOC # " & i & " of " & counter & " TOCs"
ActiveDocument.TablesOfContents(i).Update
Next i
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
 
Top