Share via


View.ViewType Property

Outlook Developer Reference

Returns an OlViewType constant representing the view type of a View object. Read-only.

Syntax

expression.ViewType

expression   An expression that returns a View object.

Remarks

This property does not have any effect on the icons displayed in the Shortcuts pane. Large icons have been removed and if this property is set to olLargeIcon, it will not have any effect.

Example

The following Visual Basic for Applicatons (VBA) example displays the name and type of all views in the user's Inbox.

Visual Basic for Applications
  Sub DisplayViewMode()
    'Displays the names and view modes for all views
    Dim objName As Outlook.NameSpace
    Dim objViews As Outlook.Views
    Dim objView As Outlook.View
    Dim strTypes As String
Set objName = Application.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder(olFolderInbox).Views
'Collect names and view types for all views
For Each objView In objViews
    strTypes = strTypes &amp; objView.Name &amp; vbTab &amp; vbTab &amp; objView.<strong>ViewType</strong> &amp; vbCr
Next objView
'Display message box
MsgBox "Current Inbox Views and Viewtypes:" &amp; vbCr &amp; _
    vbCr &amp; strTypes

End Sub

See Also