This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IM > IMapDocument Interface > IMapDocument.ReplaceContents Method (ArcObjects .NET 10.5 SDK) |
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
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.