Results 1 to 2 of 2

Thread: Language of Table and Figure Captions

  1. #1
    VBAX Newbie
    Mar 2019

    Language of Table and Figure Captions

    Hey everyone,

    the VBA Word API drives me nuts...
    I'm importing content from a website into word and automatically assign Table Captions and Figure Captions to be summaries in List of Tables/Figures.

    All this works fine with no problem. As of now I'm creating the captions with:
    Selection.InsertCaption Label:=wdCaptionTable, Title:=Trim(innerTextString), Position:=wdCaptionPositionAbove

    And the lists with:
    ThisDocument.TablesOfFigures.Add Range:=Selection.Range, Caption:=wdCaptionFigure, IncludeLabel:=True, IncludePageNumbers:=True

    The only issue I have is that the .dotm is used on machines with different language settings (for the OS as well as for Office). But I do want to always have the captions in English.

    In order to ensure proper content language I set the following at different positions in the code:
    ThisDocument.Content.LanguageID = wdEnglishUS

    Now, for some weird reason the captions get displayed correctly in English as supposed, but several times they switch to the language the user has set globally (maybe in the standard template...?).

    Does anyone know how to robustly set the language for the Table/Figure Captions to English, even if deployed on machines with different global language settings?

    Your support is highly appreciated!

    Also posted under:
    Last edited by Panavia; 04-16-2020 at 07:00 AM. Reason: ...

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Jul 2008
    Cross-posted at:
    Please read VBA Express' policy on Cross-Posting in Rule 3:
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

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