Document object (Visio)
Represents a drawing file (.vsd or .vdx), stencil file (.vss or .vsx), or template file (.vst or .vtx) that is open in an instance of Microsoft Visio. A Document object is a member of the Documents collection of an Application object.
Remarks
The default property of a Document object is Name.
Use the Open method of a Documents collection to open an existing document.
Use the Add method of a Documents collection to create a new document.
Use the ActiveDocument property of an Application object to retrieve the active document in an instance.
Use the Pages, Masters, and Styles properties to retrieve Page, Master, and Style objects, respectively.
Use the CustomMenus or CustomToolbars properties to access the custom menus or toolbars.
Note
The Microsoft Visual Basic for Applications (VBA) project of every Visio document also has a class module called ThisDocument. When you reference the ThisDocument module from code in a VBA project, it returns a reference to the project's Document object. For example, the code in a document's project can display the name of the project's document in a message box with this statement:
MsgBox ThisDocument.Name
If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this object maps to the following types:
- Microsoft.Office.Interop.Visio.IVDocument
Events
- 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
Methods
- 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
Properties
- 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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기