Share via


View.Reset Method

Outlook Developer Reference

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

Syntax

expression.Reset

expression   A variable that represents a View object.

Remarks

This method works only on built-in Outlook views.

To properly reset the current view, you must do a View.Reset and then a View.Apply. The code sample below illustrates the order of the calls:

Visual Basic for Applications
  Sub ResetView()
    Dim v as Outlook.View
    ' Save a reference to the current view object	
    Set v = Application.ActiveExplorer.CurrentView
    ' Reset and then apply the current view
    v.Reset
    v.Apply
End Sub

Example

The following Microsoft Visual Basic/Visual Basic for Applications (VBA) 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.

Visual Basic for Applications
  Sub ResetViews()
    'Resets all standard views in the user's Inbox
Dim objName As Outlook.NameSpace
Dim objViews As Outlook.Views
Dim objView As Outlook.View
    
Set objName = Application.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder(olFolderInbox).Views
For Each objView In objViews
    If objView.Standard = True Then
        objView.<strong>Reset</strong>
    End If
Next objView

End Sub

See Also