Language Property

Microsoft Outlook Visual Basic

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 example sets the language type of all View object's of type olTableView to US English.

Sub SetLanguage()
'Sets the language of all table views to US English

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

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

End Sub