LanguageSettings 对象

优质
小牛编辑
133浏览
2023-12-01

返回 Microsoft Office 应用程序中有关语言设置的信息。

使用 LanguageSettings 对象

使用Application.LanguageSettings.LanguageIDMsoAppLanguageID),此处MsoAppLanguageID 是一个用于将地区标识符 (LCID) 信息返回到指定应用程序的常量。

以下示例在消息框中显示安装语言、用户界面语言和帮助语言的 LCID。

MsgBox "The following locale IDs are registered " & _
 "for this application: Install Language - " & _
 Application.LanguageSettings.LanguageID(msoLanguageIDInstall) & _
 " User Interface Language - " & _
 Application.LanguageSettings.LanguageID(msoLanguageIDUI) & _
 " Help Language - " & _
 Application.LanguageSettings.LanguageID(msoLanguageIDHelp)

如下例所示,可用Application.LanguageSettings.LanguagePreferredForEditing 来判断哪些 LCID 被注册为应用程序的首选编辑语言。

If Application.LanguageSettings. _
 LanguagePreferredForEditing(msoLanguageIDEnglishUS) Then
 MsgBox "U.S. English is one of the chosen editing languagess."
End If
LanguageSettings
MsoAppLanguageID 可为以下 MsoAppLanguageID 常量之一:
msoLanguageIDExeMode
msoLanguageIDHelp
msoLanguageIDInstall
msoLanguageIDUI
msoLanguageIDUIPrevious