Visio) (文档对象
表示在 Microsoft Visio 实例中打开的绘图文件 (.vsd 或 .vdx) 、模具文件 (.vss 或 .vsx) ,或模板文件 (.vst 或 .vtx) 。 Document 对象是 Application 对象的 Documents 集合的成员。
Document 对象的默认属性为 Name。
使用 Documents 集合的 Open 方法打开现有文档。
使用 Documents 集合的 Add 方法创建新文档。
使用 Application 对象的 ActiveDocument 属性检索实例中的活动文档。
使用 Pages、 Masters 和 Styles 属性可分别检索 Page、 Master 和 Style 对象。
使用 CustomMenus 或 CustomToolbars 属性访问自定义菜单或工具栏。
备注
每个 Visio 文档的 Microsoft Visual Basic for Applications (VBA) 项目也有一个名为 ThisDocument 的类模块。 当从 VBA 项目中的代码中引用 ThisDocument 模块时,它将返回对该项目的 Document 对象的引用。 例如,文档的项目中的代码可以用以下语句在消息框中显示项目的文档的名称:
MsgBox ThisDocument.Name
如果 Visual Studio 解决方案包含 Microsoft.Office.Interop.Visio 引用,则此对象映射到以下类型:
- Microsoft.Office.Interop.Visio.IVDocument
- AfterDocumentMerge
- AfterRemoveHiddenInformation
- BeforeDataRecordsetDelete
- BeforeDocumentClose
- BeforeDocumentSave
- BeforeDocumentSaveAs
- BeforeMasterDelete
- BeforePageDelete
- BeforeSelectionDelete
- BeforeShapeTextEdit
- BeforeStyleDelete
- ConvertToGroupCanceled
- DataRecordsetAdded
- DesignModeEntered
- DocumentChanged
- DocumentCloseCanceled
- DocumentCreated
- DocumentOpened
- DocumentSaved
- DocumentSavedAs
- GroupCanceled
- MasterAdded
- MasterChanged
- MasterDeleteCanceled
- PageAdded
- PageChanged
- PageDeleteCanceled
- QueryCancelConvertToGroup
- QueryCancelDocumentClose
- QueryCancelGroup
- QueryCancelMasterDelete
- QueryCancelPageDelete
- QueryCancelSelectionDelete
- QueryCancelStyleDelete
- QueryCancelUngroup
- RuleSetValidated
- RunModeEntered
- SelectionDeleteCanceled
- ShapeAdded
- ShapeDataGraphicChanged
- ShapeExitedTextEdit
- ShapeParentChanged
- StyleAdded
- StyleChanged
- StyleDeleteCanceled
- UngroupCanceled
- AddUndoUnit
- BeginUndoScope
- CanCheckIn
- CanUndoCheckOut
- CheckIn
- Clean
- ClearCustomMenus
- ClearCustomToolbars
- ClearGestureFormatSheet
- Close
- CopyPreviewPicture
- DeleteSolutionXMLElement
- Drop
- EndUndoScope
- ExecuteLine
- ExportAsFixedFormat
- FollowHyperlink
- GetThemeNames
- GetThemeNamesU
- OpenStencilWindow
- ParseLine
- PrintOut
- PurgeUndo
- RemoveHiddenInformation
- RenameCurrentScope
- Save
- SaveAs
- SaveAsEx
- SetCustomMenus
- SetCustomToolbars
- UndoCheckOut
- AlternateNames
- Application
- AutoRecover
- BottomMargin
- BuildNumberCreated
- BuildNumberEdited
- Category
- ClassID
- Colors
- Comments
- Company
- CompatibilityMode
- Container
- ContainsWorkspaceEx
- Creator
- CustomMenus
- CustomMenusFile
- CustomToolbars
- CustomToolbarsFile
- CustomUI
- DataRecordsets
- DefaultFillStyle
- DefaultGuideStyle
- DefaultLineStyle
- DefaultSavePath
- DefaultStyle
- DefaultTextStyle
- Description
- DiagramServicesEnabled
- DocumentSheet
- DynamicGridEnabled
- EditorCount
- EmailRoutingData
- EventList
- Fonts
- FooterCenter
- FooterLeft
- FooterMargin
- FooterRight
- FullBuildNumberCreated
- FullBuildNumberEdited
- FullName
- GestureFormatSheet
- GlueEnabled
- GlueSettings
- HeaderCenter
- HeaderFooterColor
- HeaderFooterFont
- HeaderLeft
- HeaderMargin
- HeaderRight
- HyperlinkBase
- ID
- Index
- InPlace
- Keywords
- Language
- LeftMargin
- MacrosEnabled
- Manager
- Masters
- MasterShortcuts
- Mode
- Name
- ObjectType
- OLEObjects
- Pages
- PaperHeight
- PaperSize
- PaperWidth
- Path
- Permission
- PersistsEvents
- PreviewPicture
- PrintCenteredH
- PrintCenteredV
- Printer
- PrintFitOnPages
- PrintLandscape
- PrintPagesAcross
- PrintPagesDown
- PrintScale
- ProgID
- Protection
- ReadOnly
- RemovePersonalInformation
- RightMargin
- Saved
- SavePreviewMode
- ServerPublishOptions
- SharedWorkspace
- SnapAngles
- SnapEnabled
- SnapExtensions
- SnapSettings
- SolutionXMLElement
- SolutionXMLElementCount
- SolutionXMLElementExists
- SolutionXMLElementName
- Stat
- Styles
- Subject
- Sync
- Template
- Time
- TimeCreated
- TimeEdited
- TimePrinted
- TimeSaved
- Title
- TopMargin
- Type
- UndoEnabled
- UserCustomUI
- Validation
- VBProject
- VBProjectData
- Version
- ZoomBehavior
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。