Поделиться через


How to: Target the Office multilingual user interface

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The Multilingual User Interface (MUI) is a Microsoft Office feature that gives the end user the ability to change the language of the user interface (UI). For example, an end user working with an English UI can change the language of the UI to Spanish.

Applies to: The information in this topic applies to document-level projects and VSTO Add-in projects. See Features available by Office application and project type.

If your application will be used by people who use many languages of Office, you can add code to automatically change the language of your UI strings to match the language being used by Office on the user's computer (if the user has the correct resources installed).

To check the current Office UI setting

  1. Use the CurrentUICulture property of the current thread. Set the language of your UI strings to match the language used by the version of Office that currently runs on the user's computer.

    System.Threading.Thread.CurrentThread.CurrentUICulture = _
        New System.Globalization.CultureInfo( _
            Application.LanguageSettings.LanguageID( _
                Office.MsoAppLanguageID.msoLanguageIDUI))
    
    System.Threading.Thread.CurrentThread.CurrentUICulture =
        new System.Globalization.CultureInfo(
            Application.LanguageSettings.get_LanguageID(
                Office.MsoAppLanguageID.msoLanguageIDUI));
    

See also