A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Automatically Update a Table of Contents



 
 
Thread Tools Display Modes
  #1  
Old September 30th, 2009, 01:13 PM posted to microsoft.public.word.newusers
akkrug
external usenet poster
 
Posts: 122
Default Automatically Update a Table of Contents

I have added a button to a template to update the table of contents when it
is pressed. My boss asked me if there was a way to automatically update the
template so the user didn't have to do anything. Please let me know if this
can be done (i.e. automatically run the macro).

As always, thanks for the help!!

Ken K.
--
akkrug
  #2  
Old September 30th, 2009, 01:47 PM posted to microsoft.public.word.newusers
Stefan Blom[_3_]
external usenet poster
 
Posts: 4,556
Default Automatically Update a Table of Contents

Place the following auto macro in the Normal template for each user:

Sub AutoOpen()
Dim toc As TableOfContents
For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next toc
End Sub

See also http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP



"akkrug" wrote in message
...
I have added a button to a template to update the table of contents when it
is pressed. My boss asked me if there was a way to automatically update
the
template so the user didn't have to do anything. Please let me know if
this
can be done (i.e. automatically run the macro).

As always, thanks for the help!!

Ken K.
--
akkrug




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.