Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
tjb tjb is offline
external usenet poster
 
Posts: 8
Default Table of Contents Automatic Update

Is there a way that I can set the table of contents to automatically update
like when I save or close a document? If so, how? Thanks!
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Table of Contents Automatic Update

The following pair of macros should work:

Sub FileSave()
Dim t As TableOfContents
For Each t In ActiveDocument.TablesOfContents
t.Update
Next t
If ActiveDocument.Path = "" Then
Dialogs(wdDialogFileSaveAs).Show
Else
ActiveDocument.Save
End If
End Sub

Sub FileSaveAs()
Dim t As TableOfContents
For Each t In ActiveDocument.TablesOfContents
t.Update
Next t
Dialogs(wdDialogFileSaveAs).Show
End Sub

Place the macros in the Normal template. See
http://www.gmayor.com/installing_macro.htm for assistance.

--
Stefan Blom
Microsoft Word MVP
(Message posted via msnews.microsoft.com)



"tjb" wrote in message
...
Is there a way that I can set the table of contents to automatically update
like when I save or close a document? If so, how? Thanks!




  #3   Report Post  
Posted to microsoft.public.word.pagelayout
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Table of Contents Automatic Update

The following pair of macros should work:

Sub FileSave()
Dim t As TableOfContents
For Each t In ActiveDocument.TablesOfContents
t.Update
Next t
If ActiveDocument.Path = "" Then
Dialogs(wdDialogFileSaveAs).Show
Else
ActiveDocument.Save
End If
End Sub

Sub FileSaveAs()
Dim t As TableOfContents
For Each t In ActiveDocument.TablesOfContents
t.Update
Next t
Dialogs(wdDialogFileSaveAs).Show
End Sub

Place the macros in the Normal template. See
http://www.gmayor.com/installing_macro.htm for assistance.

--
Stefan Blom
Microsoft Word MVP
(Message posted via msnews.microsoft.com)



"tjb" wrote in message
...
Is there a way that I can set the table of contents to automatically update
like when I save or close a document? If so, how? Thanks!




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Table of Contents: Document Not Seeing heading update Brent E Microsoft Word Help 2 June 8th 12 04:53 PM
Automatic table of contents Tracy W New Users 1 November 1st 08 03:29 PM
Update Table of Contents tinks New Users 1 September 25th 08 04:58 PM
Automatic Table of Contents update Jenny Microsoft Word Help 4 November 6th 07 08:07 PM
Update Table of Contents DeanH Microsoft Word Help 5 November 7th 06 10:05 PM


All times are GMT +1. The time now is 05:06 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"