ViewCtl 对象 (Outlook 视图控件)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.

说明Remarks

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.

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.