TOC in Word 2010

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

TOC in Word 2010

Post by Robie »

Is it possible for TOC to be updated automatically (when adding Heading 1/2 paragraphs, when document is opened or when document is closed/saved) in WORD 2010?

At the moment I do this when closing the document because it may take long time to update the TOC. It is just a total mess. I would rather leave everything to Word.

Also, has the page numbering problem fixed in 2010, i.e. when opening a document it set all entries to a single page number?

Thanks.

User avatar
StuartR
Administrator
Posts: 12653
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: TOC in Word 2010

Post by StuartR »

Robie wrote:Is it possible for TOC to be updated automatically (when adding Heading 1/2 paragraphs, when document is opened or when document is closed/saved) in WORD 2010?
...
You would need to use event procedures for the DocumentChange, Document_Open and Document_Close events. A DocumentChange event procedure can be problematic as it is triggered for every character that you type. You could do something like store a static variable that indicates if you are currently editing a Level 1 or Level 2 heading, and when this changes to a non heading paragraph you could update the TOC.

I think a simpler solution would be to have a normal Macro that updates the TOC and put a shortcut to this on the Quick Access Toolbar.
Robie wrote:...Also, has the page numbering problem fixed in 2010, i.e. when opening a document it set all entries to a single page number?...
I think this one has been fixed for quite a long time now.
StuartR


Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: TOC in Word 2010

Post by Robie »

StuartR wrote:
Robie wrote:Is it possible for TOC to be updated automatically (when adding Heading 1/2 paragraphs, when document is opened or when document is closed/saved) in WORD 2010?
...
You would need to use event procedures for the DocumentChange, Document_Open and Document_Close events. A DocumentChange event procedure can be problematic as it is triggered for every character that you type. You could do something like store a static variable that indicates if you are currently editing a Level 1 or Level 2 heading, and when this changes to a non heading paragraph you could update the TOC.

I think a simpler solution would be to have a normal Macro that updates the TOC and put a shortcut to this on the Quick Access Toolbar.
Robie wrote:...Also, has the page numbering problem fixed in 2010, i.e. when opening a document it set all entries to a single page number?...
I think this one has been fixed for quite a long time now.
Thanks.