Visio) (Document 物件
代表繪圖檔 (.vsd 或 .vdx) 、 (.vss 或 .vsx) 的樣板檔案,或在 Microsoft Visio 實例中開啟的範本檔案 (.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 支援與意見反應。