This document is archived and information here might be outdated.  Recommended version.


MxDocument CoClass (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (ArcMapUI)  

MxDocument CoClass

Esri Mx Document.

Product Availability

Available with ArcGIS Desktop.

Description

The map document (MxDocument) is the ArcMap running application.  The overall role of the map document is to control the representation of data .  This object implements several interfaces including IMxApplication and IDocument.  IMxDocument is a starting point for accessing most of the other ArcMap objects including the collection of maps, the page layout, and the style gallery.  The IDocument interface provides access to the document's title, type, accelerator table, CommandBars collection, and VBA project.

There is one map document per session of ArcMap.  Instantiating a new MxDocument starts a new ArcMap application.  Actually, creating a new MxDocument really creates a new Application object which in turn co-creates a new MxDocument.

To edit the contents of a map document saved to a file (*.mxd) outside of an ArcMap session or without instantiating a new Application (ArcMap process), see IMapDocument.  IMapDocument provides the ability to edit and save the contents of a map document.

Supported Platforms

Windows

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.

Interfaces

Interfaces Description
IBasicDocument Provides access to members that control the Basic Document.
IBasicDocument2 Provides additional access to members that control the Basic Document.
IBasicDocumentDefaultSymbols Provides access to members that control Default basic symbols for the document.
IChangeLayout Provides access to members that control changing the document's layout.
IConnectionPointContainer Supports connection points for connectable objects.
IContentsViewEdit Provides access to members that control Contents View Edit.
IDataGraphCollection (esriCarto) Provides access to members that control graph collection in map document.
IDocument (esriFramework) Provides access to other objects in the document.
IDocumentDatasets (esriCatalogUI) Provides access to members that control the document datasets.
IDocumentDefaultSymbols Provides access to members that control Default Symbols for the document.
IDocumentDirty (esriFramework) Provides access to the dirty flag of the Document.
IDocumentDirty2 (esriFramework) Provides access to the dirty flag of the Document.
IDocumentInfo (esriCarto) Provides access to members that control the Document Info.
IDocumentInfo2 (esriCarto) Provides access to members that control the Document Info.
IDocumentPreview (esriCarto) Provides access to members that control the Document Preview.
IDocumentVersion (esriSystem) Provides access to members that control the document version.
IMapDocument (esriCarto) Provides access to members that control the reading and writing of map document files.
IMxDocument Provides access to members that control the Mx Document.
IPersist Defines the single method GetClassID, which is designed to supply the CLSID of an object that can be stored persistently in the system. IPersist is the base interface for three other interfaces: IPersistStorage, IPersistStream, and IPersistFile.
IPropertySupport (esriSystem) Provides access to members that set a default property on an object.
IReportUnitFormat Provides access to report unit formatting.
IReportUnitFormat2 Provides access to report unit formatting.
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.

Event Interfaces

Interfaces Description
IDocumentEventsDisp (default) Provides access to events that occur in ArcMap.
IDocumentEvents Provides access to events that occur in ArcMap.
IDataGraphCollectionEvents Provides access to events that occur when the collection of graphs in the document changes.

Working with Events

[Visual Basic 6.0]

When working with MxDocument's default outbound interface in Visual Basic 6 declare variables as follows:

Private WithEvents pMxDocument as MxDocument

When implementing IDocumentEvents declare variables as follows:

Private WithEvents pDocumentEvents as DocumentEvents

When implementing IDataGraphCollectionEvents declare variables as follows:

Private WithEvents pBarrierCollection as BarrierCollection