I am using Word 2007, but saving my documents in .doc (as opposed to .docx) formats because that's company policy.
I have the ToC set up fine, but is there a way to have it update automatically (at document open, save or otherwise)? Word help suggests that it should update upon opening the document, but that doesn't seem to happen.
Any ideas?
Best Answer
If there's a check mark on the option Tools > Options > Print > Update fields (in Word 2007, Office button > Word Options > Display > Update fields before printing), then going to Print Preview and back will update the fields. But it's just as easy to press Ctrl+A and then F9.
If you're looking for something that doesn't need any user interaction at all, then you need a macro.
An example of a macro to update all fields of type ToC is:
If you wish to periodically execute the above macro, here's another macro for that.
that will update the ToC every 5 minutes:
You can assign this macro to an icon or a hotkey. I wouldn't suggest to make it run automatically when the document opens, as you would run against the latest security safeguards of Microsoft.
Note: The above is untested, and even worse, is my very first attempt in writing VBA.