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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul Sauvé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
GrahamSkanRetiredCommented:
You can change the boolean value of the ShowFieldCodes  property/
ActiveWindow.View.ShowFieldCodes = True

Open in new window

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hindersalivaAuthor Commented:
Thanks Graham.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.