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


MapDocument CoClass (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

MapDocument CoClass

The MapDocument coclass is used to read and write map document files.

Product Availability

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

Description

The MapDocument CoClass encapsulates map document files (*.mxd, *mxt, *.pmf) and layer files (*.lyr) and provides properties and methods for: accessing and updating the contents of a document; determining document properties; and reading, writing and saving map documents files (*.mxd).

Supported Platforms

Windows, Solaris, Linux

Interfaces

Interfaces Description
IDocumentInfo Provides access to members that control the Document Info.
IDocumentInfo2 Provides access to members that control the Document Info.
IDocumentPreview Provides access to members that control the Document Preview.
IDocumentVersion (esriSystem) Provides access to members that control the document version.
IMapDocument Provides access to members that control the reading and writing of map document files.

Remarks

When opening or creating a map document with the IMapDocument Open() or New() methods, you should always make subsequent calls to IActiveView::Activate() in order to properly initialize the display of the PageLayout and Map objects.  Call Activate() once for the PageLayout and once for each Map you will be working with.  If your application has a user interface, you should call Activate() with the hWnd of the application's client area.  If your application runs in the background and has no windows, you can always get a valid hWnd from the GDI GetDesktopWindow() function, part of the Win32 API.