Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internationalization of TOCs (2002, 2003, 2007)

    I'm having problems with TOCs and Tables of Figures when used in other languages/regional settings.

    Documents with TOCs/TOFs in them seem to be just fine, but insertion of new TOCs/TOFs with styles listed, either by specifying the field text, e.g.
    selection.fields.add selection.range wdFieldTOC, "t ""Appendices,2"""
    or by inserting an existing one from an AutoText entry, results in an error message in the field. A little testing shows that replacing the comma with a semicolon (the list separator in the Regional and Language Options Control Panel) makes things work... but this is a major pain:

    1) I set up the AutoText entries to simplify things, now I can't depend on their being valid
    2) How would I fetch the current List Separator anyway, even if I could fix things?

    So:
    a) Is there a region-free way to specify the codes in a TOC/TOF field? Semicolon doesn't work in English
    [img]/forums/images/smilies/cool.gif[/img] Any other suggestions? I could build from scratch, using toc.HeadingStyles.Add -- how many versions of Word support that? Or I could do a Replace() function to change the commas to semis, assuming I knew when to use semis...

    Word and VBA never pass up an opportunity to confound.
    (my previous internationalization issue was that the ColumnWidths property of list boxes wants 1,3 instead of 1.3 in some regions -- so "1.3;1.5" wouldn't work, but 1.3 & ";" & 1.5 does!)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Internationalization of TOCs (2002, 2003, 2007)

    To retrieve the list separator for the system running the code, use

    Application.International(wdListSeparator)

    And the decimal separator is

    Application.International(wdDecimalSeparator)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •