CurrentView Property

Microsoft Outlook Visual Basic

Show All

CurrentView Property

       

Returns or sets an Object (for the MAPIFolder object) or Variant (for the Explorer object) representing the current view. Read/write.

expression.CurrentView

expression   Required. An expression that returns one of the objects in the Applies To list.

Remarks

When this property is set, two events occur: BeforeViewSwitch occurs before the actual view change takes place and can be used to cancel the change; ViewSwitch takes place after the change is effective.

Example

The following example sets the current view in the active explorer to Messages.

Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Set myOlExp = myOlApp.ActiveExplorer
myOlExp.CurrentView = "Messages"

If you use VBScript, you do not create the Application object. This example shows how to perform the same task using VBScript.

Application.ActiveExplorer.CurrentView = "Messages"