Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 08-12-2012, 07:26 PM
macropod's Avatar
macropod macropod is offline Update TOC Windows 7 64bit Update TOC Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Your 'TOC DOC' has nothing in it that Word would recognise as a Table of Contents. A Table of Contents in Word uses a TOC field, not a manually-created table with manually-input 'heading' entries and PAGEREF fields.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 08-12-2012, 09:13 PM
ubns ubns is offline Update TOC Windows 7 32bit Update TOC Office 2010 32bit
Competent Performer
Update TOC
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default previous post - with page ref description

Hi Paul,

Yes, actually I think I did mention before you gave the macro:

see the following quote.

Quote:
Originally Posted by ubns View Post
Actually I have just created a module. (also after having a closer look at field -- I found that the way our documet is structured - TOC is deceptive. Actually they have used Page References.

Regards

Umesh Banga
Reply With Quote
  #18  
Old 08-12-2012, 09:14 PM
ubns ubns is offline Update TOC Windows 7 32bit Update TOC Office 2010 32bit
Competent Performer
Update TOC
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default

apologies for the confusion.
Reply With Quote
  #19  
Old 08-12-2012, 09:20 PM
macropod's Avatar
macropod macropod is offline Update TOC Windows 7 64bit Update TOC Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

There's nothing in the post you quote that would indicate to anyone who doesn't have the document in front of them that the 'Table of Contents' is anything like what it is in the document you posted.

Nevertheless, given that your 'Table of Contents' is what it is, I don't know what you'd expect a macro to do about it. It certainly isn't capable of being updated in anything like the normal manner. IMHO, you'd do better to delete the one you have and insert a proper one or, better still, get whoever created the existing one to use a proper one. The current approach is crazy.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #20  
Old 08-13-2012, 08:29 PM
ubns ubns is offline Update TOC Windows 7 32bit Update TOC Office 2010 32bit
Competent Performer
Update TOC
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default

Hi Paul,

Let me know if the attachments are not what you are looking for? ofcourse when you get time.

regards

Umesh
Reply With Quote
  #21  
Old 08-13-2012, 08:49 PM
macropod's Avatar
macropod macropod is offline Update TOC Windows 7 64bit Update TOC Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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 am not looking for any attachments at this time. My last post outlined the course of action I think you need to take.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #22  
Old 08-14-2012, 11:12 PM
ubns ubns is offline Update TOC Windows 7 32bit Update TOC Office 2010 32bit
Competent Performer
Update TOC
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default

Hi,

Thanks again for your reply.

Can you please advice how can we add exception (or kind of validation) so that the following code does not throw error - if there is no table of contents in the document.

Sub AutoClose()

ActiveDocument.TablesOfContents(1).Update

End Sub
Reply With Quote
  #23  
Old 08-14-2012, 11:44 PM
macropod's Avatar
macropod macropod is offline Update TOC Windows 7 64bit Update TOC Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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 previously advised you that that code would throw an error if there was no TOC in the document - and I supplied code that wouldn't. In any event, it's pointless updating fields upon close, for two reasons at least:
1. It requires a re-save of the document after updating, even if it's already been saved; and
2. Doesn't guarantee that the updated fields will be correct if the document is opened on another PC or even on the same PC with a different active printer.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



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 12:52 AM.


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