Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2015, 08:07 AM
shabbaranks shabbaranks is offline Auto Update table of contents on close - how? Windows 7 64bit Auto Update table of contents on close - how? Office 2007
Advanced Beginner
Auto Update table of contents on close - how?
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default Auto Update table of contents on close - how?

Hi,



As the title suggests Im looking for a way to automatically update the table of contents in a word document when it closes. Ive tried:

ActiveDocument.Fields.Update

which didn't do anything - any suggestions please?

Thanks
Reply With Quote
  #2  
Old 12-07-2015, 01:39 PM
macropod's Avatar
macropod macropod is offline Auto Update table of contents on close - how? Windows 7 64bit Auto Update table of contents on close - how? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I'd be more inclined to use a Document_Open macro, coded along the lines of:
Code:
Sub Document_Open()
Application.ScreenUpdating = False
With ActiveDocument
  .Fields.Update
  .PrintPreview
  .ClosePrintPreview
End With
Application.ScreenUpdating = True
End Sub
If you try to update fields as the document closes, the updates will be lost unless you re-save the document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Update table of contents on close - how? When I update table of contents, all the links go dead! widmerpool Word Tables 1 05-02-2015 11:24 PM
Auto Update table of contents on close - how? Auto Table of Contents not working namedujour Word 3 05-16-2013 06:51 AM
Auto Update table of contents on close - how? auto-generated Table of Contents has poor formatting? dylansmith Word 7 11-02-2012 06:55 PM
Table of Contents - Direct Field Implementation - Auto-Update Numbering ztag Word 3 01-19-2012 03:04 PM
Table of Contents does not update, when document is opened on other computer jaybo Word 1 01-25-2011 04:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:16 PM.


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