Edit

Share via


_Application3.LanguageSettings Property

Definition

Gets a reference to the Microsoft Office LanguageSettings.

public:
 property System::Object ^ LanguageSettings { System::Object ^ get(); };
public object LanguageSettings { get; }
member this.LanguageSettings : obj
Public ReadOnly Property LanguageSettings As Object

Property Value

Implements

Examples

The following example uses the LanguageID property of the LanguageSettings object to return the LCID value (a four-digit number) for the language that is currently being used for the Office user interface.

This example requires a using or Imports directive for the Microsoft.Office.Core namespace in the declarations section of the form code module.

LanguageSettings langSettings = 
   (LanguageSettings) thisApplication.LanguageSettings;
int lcid = 
   langSettings.get_LanguageID(MsoAppLanguageID.msoLanguageIDUI);
Dim langSettings As LanguageSettings  = 
   DirectCast(thisApplication.LanguageSettings, LanguageSettings)
Dim lcid As Integer  = 
   langSettings.LanguageID(MsoAppLanguageID.msoLanguageIDUI)

The following example uses the LanguageID property of the LanguageSettings object to return the LCID value (a four-digit number) for the language that is currently being used for the Office user interface.

This example requires a using or Imports directive for the Microsoft.Office.Core namespace in the declarations section of the form code module.

LanguageSettings langSettings = 
   (LanguageSettings) thisApplication.LanguageSettings;
int lcid = 
   langSettings.get_LanguageID(MsoAppLanguageID.msoLanguageIDUI);
Dim langSettings As LanguageSettings  = 
   DirectCast(thisApplication.LanguageSettings, LanguageSettings)
Dim lcid As Integer  = 
   langSettings.LanguageID(MsoAppLanguageID.msoLanguageIDUI)

Remarks

After you establish a reference to the LanguageSettings object returned by the LanguageSettings property, you can access all the properties and methods of the object.

The LanguageSettings object returned by the InfoPath LanguageSettings property is implemented in the Microsoft.Office.Core namespace. The Microsoft.Office.Core.LanguageSettings object provides information about the Microsoft Office language settings that are in use on the user's computer.

To access the members of Microsoft.Office.Core namespace, you must first add a reference to the Microsoft Office 14.0 Object Library on the COM tab of the Add Reference dialog box in Visual Studio 2012.

To use the LanguageSettings property to access the Microsoft.Office.Core.LanguageSettings object, you must cast the object returned by InfoPath LanguageSettings property to the Office LanguageSettings type as shown in the code example.

Important: This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

Applies to