How to Update Entire TOC Always? in Word Tables  
 |  Edit my Profile  |  Help
 
     
  
 
 
 
Jayawanth 9/18/2007 2:36 AM PST
  Question
  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
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Stefan Blom  9/18/2007 3:38 AM PST
   
  Use a macro such as the following:

Sub UpdateAllTOCs()
For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next toc
End Sub

You can attach it to a keyboard shortcut and/or to a toolbar (or to the QAT
in Word 2007). See http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


"Jayawanth" wrote:

> 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
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Jayawanth 9/20/2007 1:55 AM PST
   
  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?

"Stefan Blom" wrote:

> Use a macro such as the following:
>
> Sub UpdateAllTOCs()
> For Each toc In ActiveDocument.TablesOfContents
> toc.Update
> Next toc
> End Sub
>
> You can attach it to a keyboard shortcut and/or to a toolbar (or to the QAT
> in Word 2007). See http://www.gmayor.com/installing_macro.htm.
>
> --
> Stefan Blom
> Microsoft Word MVP
>
>
> "Jayawanth" wrote:
>
> > 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
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Stefan Blom 9/21/2007 5:04 AM PST
  Answer
  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


"Jayawanth" wrote in message
news:3C254428-05AA-49A9-ABBF-9963B36B9E76@microsoft.com...
>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?
>
> "Stefan Blom" wrote:
>
>> Use a macro such as the following:
>>
>> Sub UpdateAllTOCs()
>> For Each toc In ActiveDocument.TablesOfContents
>> toc.Update
>> Next toc
>> End Sub
>>
>> You can attach it to a keyboard shortcut and/or to a toolbar (or to the
>> QAT
>> in Word 2007). See http://www.gmayor.com/installing_macro.htm.
>>
>> --
>> Stefan Blom
>> Microsoft Word MVP
>>
>>
>> "Jayawanth" wrote:
>>
>> > 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



 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
  Return to Microsoft Communities  Notify me of replies