View Single Post
 
Old 04-16-2020, 06:32 AM
Panavia Panavia is offline Windows 10 Office 2016
Novice
 
Join Date: Apr 2020
Posts: 2
Panavia is on a distinguished road
Default 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:
Code:
Selection.InsertCaption Label:=wdCaptionTable, Title:=Trim(innerTextString), Position:=wdCaptionPositionAbove
And the lists with:
Code:
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:
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: Language of Table and Figure Captions
Reply With Quote