Visio) 应用程序对象 (
表示 Visio 的实例。 外部程序通常要先创建或检索 Application 对象,然后才能从该实例中检索其他 Visio 对象。
使用 Microsoft Visual Basic CreateObject 函数或 New 关键字可以运行新实例,使用 GetObject 函数可以检索已经在运行的实例。 还可以将 CreateObject 函数与 InvisibleApp 对象一起使用,以运行不可见的新实例。 将 InvisibleApp 对象的 Visible 属性的值设置为 True 以显示它。
注意
从 Visio 2010 开始,Microsoft Office Fluent 用户界面 (UI) 替换了以前的分层菜单、工具栏和任务窗格系统。 用于在以前版本的 Visio 中自定义用户界面的 VBA 对象和成员在 Visio 中仍可用,但它们的功能不同。
备注
通过使用 Application 对象的 Documents、Windows 和 Addons 属性可以检索该实例的 Document、Window 和 Addon 集合。
通过使用 ActiveDocument、ActivePage 或 ActiveWindow 属性,可以检索当前活动的 Document、Page 或 Window 对象。
通过使用 BuiltInMenus、BuiltInToolbars、CustomMenus、CustomToolbars 或 CommandBars 属性,可以访问 Application 对象的菜单和工具栏。
ActiveDocument 是 Application 对象的默认属性。
注意
Visio 文档的 Microsoft Visual Basic for Applications 项目中的代码可以使用 Visio 全局对象而不是 Visio Application 对象来检索其他对象。
如果 Visual Studio 解决方案包含 Microsoft.Office.Interop.Visio 引用,则此对象映射到以下类型:
- Microsoft.Office.Interop.Visio.ApplicationClass (访问 Application 对象)
- Microsoft.Office.Interop.Visio.ApplicationClass.Application (构造 Application 对象)
- 访问Application 对象) 上的事件的Microsoft.Office.Interop.Visio.EApplication_Event (
事件
- AfterModal
- AfterRemoveHiddenInformation
- AfterReplaceShapes
- AfterResume
- AfterResumeEvents
- AppActivated
- AppDeactivated
- AppObjActivated
- AppObjDeactivated
- BeforeDataRecordsetDelete
- BeforeDocumentClose
- BeforeDocumentSave
- BeforeDocumentSaveAs
- BeforeMasterDelete
- BeforeModal
- BeforePageDelete
- BeforeQuit
- BeforeReplaceShapes
- BeforeSelectionDelete
- BeforeShapeDelete
- BeforeShapeTextEdit
- BeforeStyleDelete
- BeforeSuspend
- BeforeSuspendEvents
- BeforeWindowClosed
- BeforeWindowPageTurn
- BeforeWindowSelDelete
- CalloutRelationshipAdded
- CalloutRelationshipDeleted
- CellChanged
- ConnectionsAdded
- ConnectionsDeleted
- ContainerRelationshipAdded
- ContainerRelationshipDeleted
- ConvertToGroupCanceled
- DataRecordsetAdded
- DataRecordsetChanged
- DesignModeEntered
- DocumentChanged
- DocumentCloseCanceled
- DocumentCreated
- DocumentOpened
- DocumentSaved
- DocumentSavedAs
- EnterScope
- ExitScope
- FormulaChanged
- GroupCanceled
- KeyDown
- KeyPress
- KeyUp
- MarkerEvent
- MasterAdded
- MasterChanged
- MasterDeleteCanceled
- MouseDown
- MouseMove
- MouseUp
- MustFlushScopeBeginning
- MustFlushScopeEnded
- NoEventsPending
- OnKeystrokeMessageForAddon
- PageAdded
- PageChanged
- PageDeleteCanceled
- QueryCancelConvertToGroup
- QueryCancelDocumentClose
- QueryCancelGroup
- QueryCancelMasterDelete
- QueryCancelPageDelete
- QueryCancelQuit
- QueryCancelReplaceShapes
- QueryCancelSelectionDelete
- QueryCancelStyleDelete
- QueryCancelSuspend
- QueryCancelSuspendEvents
- QueryCancelUngroup
- QueryCancelWindowClose
- QuitCanceled
- ReplaceShapesCanceled
- RuleSetValidated
- RunModeEntered
- SelectionAdded
- SelectionChanged
- SelectionDeleteCanceled
- ShapeAdded
- ShapeChanged
- ShapeDataGraphicChanged
- ShapeExitedTextEdit
- ShapeLinkAdded
- ShapeLinkDeleted
- ShapeParentChanged
- StyleAdded
- StyleChanged
- StyleDeleteCanceled
- SuspendCanceled
- SuspendEventsCanceled
- TextChanged
- UngroupCanceled
- ViewChanged
- VisioIsIdle
- WindowActivated
- WindowChanged
- WindowCloseCanceled
- WindowOpened
- WindowTurnedToPage
方法
- AddUndoUnit
- BeginUndoScope
- ClearCustomMenus
- ClearCustomToolbars
- ConvertResult
- DoCmd
- EndUndoScope
- EnumDirectories
- FormatResult
- FormatResultEx
- GetBuiltInStencilFile
- GetCustomStencilFile
- GetPreviewEnabled
- InvokeHelp
- OnComponentEnterState
- PurgeUndo
- QueueMarkerEvent
- Quit
- Redo
- RegisterRibbonX
- RenameCurrentScope
- SetCustomMenus
- SetCustomToolbars
- SetPreviewEnabled
- Undo
- UnregisterRibbonX
属性
- Active
- ActiveDocument
- ActivePage
- ActivePrinter
- ActiveWindow
- AddonPaths
- Addons
- AlertResponse
- Application
- Assistance
- AutoLayout
- AutoRecoverInterval
- AvailablePrinters
- Build
- BuiltInMenus
- BuiltInToolbars
- COMAddIns
- CommandBars
- CommandLine
- ConnectorToolDataObject
- CurrentEdition
- CurrentScope
- CustomMenus
- CustomMenusFile
- CustomToolbars
- CustomToolbarsFile
- DataFeaturesEnabled
- DefaultAngleUnits
- DefaultDurationUnits
- DefaultRectangleDataObject
- DefaultTextUnits
- DefaultZoomBehavior
- DeferRecalc
- DeferRelationshipRecalc
- DialogFont
- Documents
- DrawingPaths
- EventInfo
- EventList
- EventsEnabled
- FullBuild
- HelpPaths
- InhibitSelectChange
- InstanceHandle32
- InstanceHandle64
- IsInScope
- IsUndoingOrRedoing
- IsVisio32
- Language
- LanguageHelp
- LanguageSettings
- LiveDynamics
- MyShapesPath
- Name
- ObjectType
- OnDataChangeDelay
- Path
- PersistsEvents
- ProcessID
- PromptForSummary
- SaveAsWebObject
- ScreenUpdating
- Settings
- ShowChanges
- ShowProgress
- ShowStatusBar
- ShowToolbar
- StartupPaths
- Stat
- StencilPaths
- TemplatePaths
- TraceFlags
- TypelibMajorVersion
- TypelibMinorVersion
- UndoEnabled
- UserName
- VBAEnabled
- VBE
- Version
- Visible
- Window
- WindowHandle32
- Windows
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。