View Single Post
  #2   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Broken TOC updating

Hi ,

I've been looking at some macros to automatically change a toc in word
2000 to enable clickable entries (the \h in the toc field), then update
the toc.

Now whenever I try to update the toc, I no longer get the option of
updating line numbers or the whole table. This happens whether I run
the macro or not.

As far as I know I should be able to update the toc with

ActiveDocument.TablesOfContents(1).Update

or all fields with

Sub UpdateFields()
Dim pRange As Word.Range
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

But like I say, one of these has broken my toc updating. Even deleting
the toc and adding another does not affect this behaviour.

Updating all fields using VBA never sends an update to a TOC field. Those
have to be updated explicitly.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)