全部显示

CurrentView 属性

       

返回或设置当前视图Object (对于 MAPIFolder 对象)或 Variant (对于 Explorer 对象)类型,可读写。

expression.CurrentView

expression  必选。该表达式返回“应用于”列表中的一个对象。

说明

设置该属性后,将发生两个事件:一是在实际视图更改前发生 BeforeViewSwitch 事件,可以用于取消更改;二是在更改生效后发生 ViewSwitch 事件。

示例

以下示例将活动浏览器中的当前视图设置为“邮件”。

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

如果使用 VBScript,则不必创建 Application 对象。本示例说明如何使用 VBScript 执行相同任务。

Application.ActiveExplorer.CurrentView = "Messages"