ArcObjects Library Reference (Carto)  

IMapDocument.ReplaceContents Method

Replace the contents of the map document.

[Visual Basic .NET]
Public Sub ReplaceContents ( _
    ByVal pObject As IMxdContents _
)
[C#]
public void ReplaceContents (
    IMxdContents pObject
);
[C++]
HRESULT ReplaceContents(
  IMxdContents* pObject
);
[C++]

Parameters

pObject [in]

  pObject is a parameter of type IMxdContents

Product Availability

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

Description

Replaces the contents of the MapDocument with the contents of the specified Map, PageLayout, MapControl or PageLayoutControl. Before using the ReplaceContents method a New MapDocument must be created or an existing MapDocument must be Open.

If a MapControl  is passed to the ReplaceContents method the MapDocument will be replaced with the IMapControl2::Map. Likewise, if a PageLayoutControl is passed to the ReplaceContents method the MapDocument will be replaced with the IPageLayoutControl::PageLayout.

If the MapDocument contents is replaced with the contents of a Map or MapControl a portriat PageLayout containing the map will be created.

 

See Also

IMapDocument Interface

.NET Samples

Synchronized MapControl and PageLayoutControl application (Code Files: frmMain) | Simple dynamic display application (Code Files: MainForm) | Implementing a property page for an ArcGIS Engine application (Code Files: frmMain) | Save a layer file in a MapControl application (Code Files: frmMain) | Schematics Engine application (Code Files: MainForm) | Temporal statistics (Code Files: MainForm)