ViewType Property

Microsoft Outlook Visual Basic

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. In previous versions of Microsoft Outlook, it returns or sets the icon view displayed by the specified Outlook Bar group. Read/write OlOutlookBarViewType.

OlOutlookBarViewType can be one of these OlOutlookBarViewType constants.
olLargeIcon
olSmallIcon

expression.ViewType

expression    Required. An expression that returns an OutlookBarGroup object.

ShowViewType property as it applies to the View object.

Returns an OlViewType constant that represents the type of the current view. Read-only.

OlViewType can be one of these OlViewType constants.
olCalendarView
olCardView
olIconView
olTableView
olTimelineView

expression.ViewType

expression    Required. An expression that returns a View object.

Example

ShowAs it applies to the OutlookBarGroup object.

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

ShowAs it applies to the View object.

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

Sub DisplayViewMode()
'Displays the names and view modes for all views

    Dim olApp As Outlook.Application
    Dim objName As Outlook.NameSpace
    Dim objViews As Outlook.Views
    Dim objView As Outlook.View
    Dim strTypes As String

    Set olApp = New Outlook.Application
    Set objName = olApp.GetNamespace("MAPI")
    Set objViews = objName.GetDefaultFolder(olFolderInbox).Views

    'Collect names and view types for all views
    For Each objView In objViews
        strTypes = strTypes & objView.Name & vbTab & vbTab & objView.ViewType & vbCr
    Next objView

    'Display message box
    MsgBox "Current Inbox Views and Viewtypes:" & vbCr & _
        vbCr & strTypes

End Sub