Word - Table of Contents won't update

In my Word app I have a Table of Contents. It looks like this
My TOC
It won't update with VBA code. (It did update previously, but now it doesn't)
    ActiveDocument.TablesOfContents(1).Update

Open in new window


I tried doing it manually. References > Table of Content ....
And No! It does not update!

I also did Ctl-A and F9
Still nothing!

Thanks for any help
hindersalivaAsked:
Who is Participating?
 
GrahamSkanConnect With a Mentor RetiredCommented:
You can change the boolean value of the ShowFieldCodes  property/
ActiveWindow.View.ShowFieldCodes = True

Open in new window

1
 
Paul SauvéConnect With a Mentor RetiredCommented:
to switch between the field code & it's value, use Alt-F9

10 things you need to know about using Word fields
To toggle between the field code and its resulting value, select the entire field and press Shift + F9. To toggle all the fields in your document, press Alt + F9. So if you open a document and see field codes instead of results, simply press Alt + F9 to toggle them all.May 16, 2014
0
 
hindersalivaAuthor Commented:
Thanks Paul. That's it!

As I'm running the TOC update in code, how can I toggle the Alt-F9 in code - if it needs toggling?
Thanks
0
 
Paul SauvéRetiredCommented:
how can I toggle the Alt-F9 in code
- sorry, i don't do VBA!

but unless you open the document, i don't think you can know if the fields are toggled on or off
0
 
hindersalivaAuthor Commented:
Thanks Graham.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.