![]() |
#2
|
|||
|
|||
![]()
You will have to create a Autoclose macro for that.
1. Press Alt+F11. This will open the Macro code window. 2. On the left hand side, there is a window called Project. Under the Window, go to the Project which has the name of your document. If you double-click on that, it expands and will show "This Document" below. Double-click on "This Window". 2. In the blank window on the right hand side, type the text given below between the dotted lines: ------- Sub AutoClose() ActiveDocument.TablesOfContents(1).Update End Sub ---------- 3. Close the window and save the file. Test and see. Make a change in the headings, and close the document without updating TOC. When you reopen it, you should find the TOC updated. This code assumes that you have only one TOC in your document. If you have more than one, then you have to change the number in the brackets of TablesOfContents() accordingly. If it is the second TOC, then it will be TablesOfContents(2) and so on. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Jennifer Murphy | Word | 10 | 08-31-2015 08:54 AM |
live update | gilgold | Excel | 0 | 05-26-2010 10:49 AM |
VBA to update certain (but not all) fields | sparkyrose | Word VBA | 0 | 05-20-2010 12:50 PM |
Project Auto-Update | hB-sys | Project | 0 | 04-15-2010 06:46 AM |
MS update failure | kbstinky | Outlook | 0 | 07-18-2009 10:59 AM |