Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-31-2012, 05:44 AM
Venky62 Venky62 is offline Update TOC Windows 7 64bit Update TOC Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 58
Venky62 is on a distinguished road
Post

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.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Update TOC Organizer does not update some styles 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft