Compartilhar via


Language Property

Returns or sets the language setting for the object that defines the language used in the menu. The Language property uses a String to represent an ISO language tag. For example, the string "EN-US" represents the ISO code for "United States - English." Read/write.

expression.Language

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

If a valid language code is specified, the object will only be available in the View menu for the specified language type. If no value is specified, the object item is available for all language types. The default value for this property is an empty String.

Example

The following Microsoft Visual Basic/Visual Basic for Applications (VBA) example sets the language type of all View objects of type olTableView to U.S. English.

Sub SetLanguage()
'Sets the language of all table views to U.S. English.

    Dim olApp As Outlook.Application
    Dim objViews As Outlook.Views
    Dim objView As Outlook.View

    Set olApp = New Outlook.Application
    Set objViews = _
        olApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Views
    'Iterate through each view in the collection.
    For Each objView In objViews
        Debug.Print objView.Name
        'If view is of type olTableVIew then set language.
        If objView.ViewType = olTableView And objView.Standard = False Then
            objView.Language = "EN-US"
        End If
    Next objView

End Sub

Applies to | ContactItem Object | View Object