Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
claesafk claesafk is offline
external usenet poster
 
Posts: 2
Default How to make table of contents for different regional settings?

I am trying to design a Word template to be used in the company I work for.
Most of the computers are set up to be used in Sweden. This means, for
example, that the comma is used for decimal separator and the semi-colon is
used as a list separator. Most of our writing is made in English. Some
engineers have set the regional settings to use "." as a decimal separator
and the "," as a list separator. This is a problem when, for example,
creating a Word template with table of contents.

Is there a way to write a macro that reads the list separator from from the
regional settings and creates an appropriate TOC field code?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How to make table of contents for different regional settings?

Is the problem mainly with the list separator in e.g.

{ TOC \t "style1,1,style2,2" \h \z \u }

? If so, something that may work as long as you know all the possible list
separators that your documents' users /might/ use is to use something like
the following immediately before the TOC field:

{ IF { =product(2;3) } = 6 "{ SET list ";" }" "" }{ IF { =product(2,3) } = 6
"{ SET list "," }" "" }

then use

{ TOC \t "style1{ list }1{ list }style2{ list }2" \h \z \u }

where all the {} have to be the special field code braces you can insert
using ctrl-F9

I wouldn't put this into any mailmerge main documents as it will cause
errors to pop up when you merge.



--
Peter Jamieson
http://tips.pjmsn.me.uk

"claesafk" wrote in message
...
I am trying to design a Word template to be used in the company I work for.
Most of the computers are set up to be used in Sweden. This means, for
example, that the comma is used for decimal separator and the semi-colon
is
used as a list separator. Most of our writing is made in English. Some
engineers have set the regional settings to use "." as a decimal separator
and the "," as a list separator. This is a problem when, for example,
creating a Word template with table of contents.

Is there a way to write a macro that reads the list separator from from
the
regional settings and creates an appropriate TOC field code?


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
claesafk claesafk is offline
external usenet poster
 
Posts: 2
Default How to make table of contents for different regional settings?

Peter,
Thank you for the tip! It works. This was exactly what I wanted to do. I am
now trying to figure out were to put the code to make sure that it is
"executed" before the TOC is updated and that it is not removed by the user
(as it is invisible). Is there a way to force "update fields" when
opening/closing/printing the document? Personally, I usually click on the TOC
and press F9 to update the table. If I do that without updating the field you
suggested first, I will get an error.

Best regards,
Claes af Klinteberg

"Peter Jamieson" wrote:

Is the problem mainly with the list separator in e.g.

{ TOC \t "style1,1,style2,2" \h \z \u }

? If so, something that may work as long as you know all the possible list
separators that your documents' users /might/ use is to use something like
the following immediately before the TOC field:

{ IF { =product(2;3) } = 6 "{ SET list ";" }" "" }{ IF { =product(2,3) } = 6
"{ SET list "," }" "" }

then use

{ TOC \t "style1{ list }1{ list }style2{ list }2" \h \z \u }

where all the {} have to be the special field code braces you can insert
using ctrl-F9

I wouldn't put this into any mailmerge main documents as it will cause
errors to pop up when you merge.



--
Peter Jamieson
http://tips.pjmsn.me.uk

"claesafk" wrote in message
...
I am trying to design a Word template to be used in the company I work for.
Most of the computers are set up to be used in Sweden. This means, for
example, that the comma is used for decimal separator and the semi-colon
is
used as a list separator. Most of our writing is made in English. Some
engineers have set the regional settings to use "." as a decimal separator
and the "," as a list separator. This is a problem when, for example,
creating a Word template with table of contents.

Is there a way to write a macro that reads the list separator from from
the
regional settings and creates an appropriate TOC field code?



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How to make table of contents for different regional settings?

I am
now trying to figure out were to put the code to make sure that it is
"executed" before the TOC is updated


It's always difficult to /ensure that such stuff is updated but nesting all
the fields inside a { QUOTE } field may slightly reduce the possibility that
someone will update the TOC without the other stuff.

e.g. { QUOTE { IF { =product(2;3) } = 6 "{ SET list ";" }" "" }{ IF {
=product(2,3) } = 6 "{ SET list "," }" "" }{ TOC \t "style1,1,style2,2" \h
\z \u } }

Is there a way to force "update fields" when
opening/closing/printing the document?


Only really by using an Auto macro such as AutoOpen (e.g. if you know the
QUOTE field is the first field,

Sub AutoOpen()
ActiveDocument.Content.Fields(1).Select
Selection.Fields.Update
End Sub

may be enough)

--
Peter Jamieson
http://tips.pjmsn.me.uk

"claesafk" wrote in message
...
Peter,
Thank you for the tip! It works. This was exactly what I wanted to do. I
am
now trying to figure out were to put the code to make sure that it is
"executed" before the TOC is updated and that it is not removed by the
user
(as it is invisible). Is there a way to force "update fields" when
opening/closing/printing the document? Personally, I usually click on the
TOC
and press F9 to update the table. If I do that without updating the field
you
suggested first, I will get an error.

Best regards,
Claes af Klinteberg

"Peter Jamieson" wrote:

Is the problem mainly with the list separator in e.g.

{ TOC \t "style1,1,style2,2" \h \z \u }

? If so, something that may work as long as you know all the possible
list
separators that your documents' users /might/ use is to use something
like
the following immediately before the TOC field:

{ IF { =product(2;3) } = 6 "{ SET list ";" }" "" }{ IF { =product(2,3) }
= 6
"{ SET list "," }" "" }

then use

{ TOC \t "style1{ list }1{ list }style2{ list }2" \h \z \u }

where all the {} have to be the special field code braces you can insert
using ctrl-F9

I wouldn't put this into any mailmerge main documents as it will cause
errors to pop up when you merge.



--
Peter Jamieson
http://tips.pjmsn.me.uk

"claesafk" wrote in message
...
I am trying to design a Word template to be used in the company I work
for.
Most of the computers are set up to be used in Sweden. This means, for
example, that the comma is used for decimal separator and the
semi-colon
is
used as a list separator. Most of our writing is made in English. Some
engineers have set the regional settings to use "." as a decimal
separator
and the "," as a list separator. This is a problem when, for example,
creating a Word template with table of contents.

Is there a way to write a macro that reads the list separator from from
the
regional settings and creates an appropriate TOC field code?




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make labels from contents in a table i.e table of content lilhoot Microsoft Word Help 4 October 24th 08 05:51 PM
how do you make a table on contents terry Microsoft Word Help 1 May 6th 08 09:25 PM
How to make a table of contents? alica Microsoft Word Help 3 January 5th 08 04:15 PM
regional settings affect calculation fields Northwoods Microsoft Word Help 6 February 1st 07 06:36 PM
make the table of contents wider lily Microsoft Word Help 1 September 3rd 06 12:51 AM


All times are GMT +1. The time now is 04:29 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"