Application 对象 (Visio)Application object (Visio)

表示 Visio 的一个实例。Represents an instance of Visio. 外部程序通常要先创建或检索 Application 对象,然后才能从该实例中检索其他 Visio 对象。An external program typically creates or retrieves an Application object before it can retrieve other Visio objects from that instance.

使用 Microsoft Visual Basic CreateObject 函数或 New 关键字可以运行新实例,使用 GetObject 函数可以检索已经在运行的实例。Use the Microsoft Visual Basic CreateObject function or the New keyword to run a new instance, or use the GetObject function to retrieve an instance that is already running. 还可以将 CreateObject 函数与 InvisibleApp 对象一起使用,以运行不可见的新实例。You can also use the CreateObject function with the InvisibleApp object to run a new instance that is invisible. InvisibleApp对象的Visible属性的值设置为True以显示该对象。Set the value of the InvisibleApp object's Visible property to True to show it.

备注

从 Visio 2010 开始, Microsoft Office 熟知用户界面 (UI) 取代了分层菜单、工具栏和任务窗格的上一个系统。Starting with Visio 2010, the Microsoft Office Fluent user interface (UI) replaced the previous system of layered menus, toolbars, and task panes. 在 visio 的早期版本中用于自定义用户界面的 VBA 对象和成员在 Visio 中仍然可用, 但它们的工作方式不同。VBA objects and members that you used to customize the user interface in previous versions of Visio are still available in Visio, but they function differently.

说明Remarks

通过使用 Application 对象的 DocumentsWindowsAddons 属性可以检索该实例的 DocumentWindowAddon 集合。Use the Documents, Windows, and Addons properties of an Application object to retrieve the Document, Window, and Addon collections of the instance.

通过使用 ActiveDocumentActivePageActiveWindow 属性,可以检索当前活动的 DocumentPageWindow 对象。Use the ActiveDocument, ActivePage, or ActiveWindow property to retrieve the currently active Document, Page, or Window object.

通过使用 BuiltInMenusBuiltInToolbarsCustomMenusCustomToolbarsCommandBars 属性,可以访问 Application 对象的菜单和工具栏。Use the BuiltInMenus, BuiltInToolbars, CustomMenus, CustomToolbars, or CommandBars property to access the Application object's menus and toolbars.

ActiveDocumentApplication 对象的默认属性。ActiveDocument is the default property of an Application object.

备注

Visio 文档的 Microsoft Visual Basic for Applications 项目中的代码可以使用 Visio 全局对象而不是 Visio Application 对象来检索其他对象。Code in the Microsoft Visual Basic for Applications project of a Visio document can use the Visio global object instead of a Visio Application object to retrieve other objects.

如果你的 Visual Studio 解决方案包含Microsoft. Visio reference, 则此对象映射到以下类型:If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this object maps to the following types:

  • ApplicationClass (若要访问应用程序对象)Microsoft.Office.Interop.Visio.ApplicationClass (to access the Application object)
  • ApplicationClass (用于构造Application对象) 的其他程序Microsoft.Office.Interop.Visio.ApplicationClass.Application (to construct the Application object)
  • " EApplication_Event "。(访问Application对象上的事件)Microsoft.Office.Interop.Visio.EApplication_Event (to access events on the Application object)

事件Events

方法Methods

属性Properties

支持和反馈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.