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 のサポートおよびフィードバックを参照してください。