Visio) (Application 物件
表示 Visio 的實例。 一般而言,外部程式必須先建立或擷取 Application 物件,才能從該實例擷取其他 Visio 物件。
請使用 Microsoft Visual Basic CreateObject 函數或 New 關鍵字執行新的實例,或使用 GetObject 函數擷取已在執行中的實例。 您也可以使用 CreateObject 函數及 InvisibleApp 物件執行隱藏的新實例。 將 InvisibleApp 物件的 Visible 屬性值設定為 True 以顯示它。
注意事項
從 Visio 2010 開始,Microsoft Office Fluent 使用者介面 (UI) 取代先前的階層式功能表、工具列和工作窗格系統。 您在舊版 Visio 中用來自訂使用者介面的 VBA 物件和成員仍可在 Visio 中使用,但其運作方式不同。
註解
如果要擷取實例的 Document、Window 及 Addon 集合,請使用 Application 物件的 Documents、Windows 及 Addons 屬性。
如果要擷取目前使用中的 Document、Page 或 Window 物件,請使用 ActiveDocument、ActivePage 或 ActiveWindow 屬性。
如果要存取 Application 物件的功能表及工具列,請使用 BuiltInMenus、BuiltInToolbars、CustomMenus、CustomToolbars 或 CommandBars 屬性。
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 物件)
- Microsoft.Office.Interop.Visio.EApplication_Event (存取 Application 物件上的事件)
事件
- 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 支援與意見反應。