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


IMapDocument Interface (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

IMapDocument Interface

Provides access to members that control the reading and writing of map document files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The IMapDocument interface provides properties and methods for reading map document files (*.mxd, *mxt, *.pmf) and writing and saving changes to map document files (*.mxd).  However, since it is not tied to the ArcMap application, application-specific functionality in the MapDocument will not be persisted.  Examples of application specific functionality are toolbar settings, UI customizations, VBA projects, and ArcMap graphs.  For desktop developers who need to use this functionality, the MxDocument interface located in the ArcMapUI library is a better choice.

Members

Description
Read-only property ActiveView The ActiveView of the map document.
Method Close Close the map document.
Read-only property DocumentFilename The map document filename that the MapDocument coclass is linked to.
Read-only property DocumentType The type of map document currently loaded in the object.
Read-only property DocumentVersion Indicates if the version of the map document is compatible with the current version of software.
Method GetVersionInfo Retrieve the detailed version information of the map document.
Read-only property IsMapDocument Indicates if the map document is a valid map document.
Read-only property IsPasswordProtected Indicates if the map document is protected by a passsword.
Read-only property IsPresent Indicates if the map document is present.
Read-only property IsReadOnly Indicates if the map document is read only.
Read-only property IsRestricted Indicates if the use of the map document is restricted to certain applications.
Read-only property Layer The Layer object at the specified index for the specified map.
Read-only property Map The Map object at the specified index.
Read-only property MapCount The number of Map objects contained within the map document.
Method New Creates and opens a new map document in preparation for the contents to be retrieve or updated.
Method Open Open the map document in preparation for the contents to be retrieve or updated.
Read-only property PageLayout The PageLayout object.
Read-only property Printer The printer object. If no printer object is stored in the map document this returns NULL.
Method ReplaceContents Replace the contents of the map document.
Method Save Save the contents of the map document to the bound file.
Method SaveAs Save the contents of the map document to the specified file name.
Method SetActiveView Set the ActiveView content of the map document.
Read-only property Thumbnail The thumbnail stored in the map document. If this is empty E_FAIL is returned.
Read-only property UsesRelativePaths Indicates if the data in the map document is referenced using relative paths.

CoClasses that implement IMapDocument

CoClasses and Classes Description
MapDocument The MapDocument coclass is used to read and write map document files.
MxDocument (esriArcMapUI) Esri Mx Document.

.NET Samples

Synchronized MapControl and PageLayoutControl application (Code Files: frmMain OpenNewMapDocument) | Simple dynamic display application (Code Files: MainForm) | Implementing a property page for an ArcGIS Engine application (Code Files: frmMain) | Load a map document into the PageLayoutControl (Code Files: LoadMap) | Save a layer file in a MapControl application (Code Files: frmMain) | Schematics Engine application (Code Files: MainForm) | Temporal statistics (Code Files: MainForm) | Working with packages in ArcGIS Engine (Code Files: FrmMapControl)

.NET Related Topics

How to access maps and layers via the MapDocument | How to add a layer to a map from a layer file | How to add different types of layers to a map | How to add display caching | How to create a mosaic layer | How to create AOIs and bookmarks | How to load a password-protected document | How to use symbol level drawing | Performing basic map functions | Publisher | Using ArcObjects as tool input | Using the PageLayoutControl