Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2013, 03:55 AM
ajay_p5 ajay_p5 is offline TOC not updated due to regional "separator" settings Windows 7 32bit TOC not updated due to regional "separator" settings Office 2010 32bit
Novice
TOC not updated due to regional "separator" settings
 
Join Date: Jul 2013
Posts: 2
ajay_p5 is on a distinguished road
Default TOC not updated due to regional "separator" settings

Hi:

I have a document template (.docx), which is used by different user groups in different parts of the world. Since, the different regions have different separators defined by OS settings, the TOC doesn't get updated automatically and throws an error. To mitigate this problem, I check the separator using this code , which I found online:
Code:
{ IF { =product(2;3) } = 6 "{ SET list ";" }" "" }{ IF { =product(2,3) } = 6 
"{ SET list "," }" "" }
{ TOC \t "style1{ list }1{ list }style2{ list }2" \h \z \u }
This solves the problem to a certain extent. However, whenever I try to update the TOC before the first part of the code is executed, it throws an error.

Is there a way that the first part of code is executed
automatically, whenever someone tries to update the TOC.

Please note that, this code needs to be invisible so nobody can change it and VBA is not an option.

Any useful suggestion will be highly appreciated. Please let me know if something is unclear. Thanks.

Best Regards,
Ajay
Reply With Quote
  #2  
Old 07-30-2013, 12:06 PM
Charles Kenyon Charles Kenyon is offline TOC not updated due to regional "separator" settings Windows Vista TOC not updated due to regional "separator" settings Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,453
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Your solution is innovative and shows a lot of understanding of Word.

I would suggest using a bookmark name other than "list." That term may cause you problems in documentation.

Your code is fields.
Fields are, by their very nature as a part of a document body, fragile. Bookmarks are even more fragile. Bookmarks are very easily deleted or destroyed even when the contents are displayed.

Can you put the field including the TOC in a Section of the document which is protected from editing? I believe this would mean that the only updating would be automatic upon printing. I have not tried this, just making a suggestion.

Otherwise, can your train your people to select an entire area when updating the TOC so it will include your preliminary fields? Perhaps some innocuous symbols that mark the beginning and end of the area to be updated?
Reply With Quote
  #3  
Old 07-31-2013, 07:56 AM
ajay_p5 ajay_p5 is offline TOC not updated due to regional "separator" settings Windows 7 32bit TOC not updated due to regional "separator" settings Office 2010 32bit
Novice
TOC not updated due to regional "separator" settings
 
Join Date: Jul 2013
Posts: 2
ajay_p5 is on a distinguished road
Default

Hi Charles:

Thanks a lot for your reply and a description about lists and bookmarks. Unfortunately, the organization I work for is too big and it won't be possible to train each and everyone.

However, since, it looks like we don't have any other option, we will just put a comment in the document (it's a pity, I wish Microsoft could have been more innovative), so that the user know that they have to update the code before they update the TOC.

I hope it works. Meanwhile, if you find something else, please let me know.

Thanks.
Reply With Quote
  #4  
Old 08-04-2013, 05:01 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline TOC not updated due to regional "separator" settings Windows 7 64bit TOC not updated due to regional "separator" settings Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

An alternative, which you may already have considered, is to make use of Word's built-in headings (these can be customized to suit your formatting needs). The heading styles have different names across the world, but they all respond to the \o switch: For example, { TOC \o "1-4" \h } bases the TOC on styles using Heading 1 through Heading 4.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC not updated due to regional "separator" settings How do I get auto-updated "number of days since specified date" on MS word? terry795 Word 16 01-07-2016 04:33 PM
TOC not updated due to regional "separator" settings Applying "Paper Source" settings to multiple sections in a mail merge does not apply ChrisC Mail Merge 1 06-18-2012 07:11 PM
TOC not updated due to regional "separator" settings How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
Add automatic separator in caption "Figure 1: __" poobear Word 1 05-12-2011 04:05 PM
"Outlook could not create the work file." error. All settings look good, any ideas? Booshanky Outlook 0 08-31-2010 09:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:45 AM.


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