ViewCtl Object (Outlook View Control)ViewCtl Object (Outlook View Control)

显示特定文件夹的信息,并可以集成到 Microsoft Outlook 窗体或文件夹主页提供对 Outlook 数据访问权。Displays information about a specific folder and can be integrated into a Microsoft Outlook form or folder home page that provides access to Outlook data.


ViewCtl对象提供对视图控件的编程访问。The ViewCtl object provides programmatic access to the View Control. 使用此控件仅在 Outlook 中,在 Outlook 中,位于 HTML 文件夹主页或由 Outlook 外接程序显示一个自定义 Outlook 窗体中。Use this control only within Outlook, in an HTML folder home page that is hosted in Outlook, or a custom Outlook form that is displayed by an Outlook add-in. 这将确保正在运行 Outlook 视图控件不受可能产生不利影响 Outlook 过程从继续可用于视图控件的其他因素。This makes sure that Outlook is running and that the View Control is not subject to other factors that may adversely affect the Outlook process from continuing to be available for the View Control's use. 不要使用之外的 Outlook 过程中,任何方案中的视图控件如承载在浏览器中的 HTML 页。Do not use the View Control in any scenario outside the Outlook process, such as in an HTML page hosted in a browser. 进程外,不支持方案。Out-of-process scenarios are not supported. 有关详细信息,请参阅已知问题时使用 Outlook 2010 的 Outlook 视图控件For more information, see Known issues when you use Outlook View Control with Outlook 2010.

可以以编程方式设置控件的属性,以自定义该控件中显示的文件夹和视图。You can set the control's properties programmatically to customize the folder and the view that is displayed in the control. 可以使用控件创建各种集成有 Outlook 数据的解决方案。You can use the control to create a variety of solutions that integrate Outlook data.

例如,您可以发起的 HTML 页上的多个视图控件,以便用户可以在单个窗口中查看多个文件夹的内容。For example, you can place multiple View Controls on an HTML page so that a user can view the contents of more than one folder in a single window. 在一次要向多个用户显示日历信息的情况下,这会非常有用。This can be useful in a scenario where you want to display calendar information for more than one user at a time.

若要在代码中使用ViewCtl对象,必须设置对视图控件的类型库的引用。To use the ViewCtl object in your code, you must set a reference to the View Control's type library.

设置对视图控件的类型库的引用:To set a reference to the View Control's type library:

  1. 在 Visual Basic for Applications 代码编辑器,在工具菜单上单击引用In the Visual Basic for Applications Code Editor, on the Tools menu, click References. 工具菜单上的引用命令时为可用仅模块窗口打开并在设计视图中处于活动状态。The References command on the Tools menu is available only when a Module window is open and active in Design view.

  2. 选择Microsoft Outlook 视图控件复选框。Select the Microsoft Outlook View Control check box.