Folder.CurrentView property (Outlook)
Returns a View object representing the current view. Read-only.
expression A variable that represents a Folder object.
You must save a reference to the View object returned by CurrentView before you proceed to use it for any purpose.
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
The following VBA example displays the current view of the Inbox folder.
Sub TestFolderCurrentView() Dim nsp As Outlook.NameSpace Dim mpFolder As Outlook.Folder Dim vw As Outlook.View Dim strView As String Set nsp = Application.Session Set mpFolder = nsp.GetDefaultFolder(olFolderInbox) ' Save a reference to the current view Set vw = mpFolder.CurrentView MsgBox "The Current View is: " & vw.Name End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.