Skip to content

Latest commit

 

History

History
93 lines (48 loc) · 1.95 KB

Outlook.Folder.CurrentView.md

File metadata and controls

93 lines (48 loc) · 1.95 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Folder.CurrentView property (Outlook)
vbaol11.chm2009
vbaol11.chm2009
Outlook.Folder.CurrentView
42af4345-60f1-10cd-66e5-517ca002284b
06/08/2017
medium

Folder.CurrentView property (Outlook)

Returns a View object representing the current view. Read-only.

Syntax

expression. CurrentView

expression A variable that represents a Folder object.

Remarks

To obtain a View object for the view of the current Explorer, use Explorer.CurrentView instead of the CurrentView property of the current Folder object returned by Explorer.CurrentFolder.

You must save a reference to the View object returned by CurrentView before you proceed to use it for any purpose.

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:

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 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

See also

Folder Object

[!includeSupport and feedback]