Consulting

Results 1 to 2 of 2

Thread: Language of Table and Figure Captions

  1. #1
    VBAX Newbie
    Joined
    Mar 2019
    Posts
    3
    Location

    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?


    Thanks!
    Your support is highly appreciated!
    Tobias

    Also posted under: https://www.msofficeforums.com/word-...-captions.html
    Last edited by Panavia; 04-16-2020 at 07:00 AM. Reason: ...

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: https://www.msofficeforums.com/word-...-captions.html
    Please read VBA Express' policy on Cross-Posting in Rule 3: http://www.vbaexpress.com/forum/faq...._new_faq_item3
    Cheers
    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
  •