Reset Method

Microsoft Outlook Visual Basic

Reset Method

       

Resets a built-in Microsoft Outlook view to its original settings.

expression.Reset

expression   Required. An expression that returns an object in the Applies To list.

Remarks

This method works only on built-in Outlook views.

Example

The following example resets all built-in views in the user's Inbox to their original settings. The Standard property is returned to determine if the view is a built-in Outlook view.

Sub ResetViews()
'Resets all standard views in the user's Inbox

    Dim olApp As Outlook.Application
    Dim objName As NameSpace
    Dim objViews As Views
    Dim objView As View
        
    Set olApp = Outlook.Application
    Set objName = olApp.GetNamespace("MAPI")
    Set objViews = objName.GetDefaultFolder(olFolderInbox).Views
    For Each objView In objViews
        If objView.Standard = True Then
            objView.Reset
        End If
    Next objView

End Sub