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.
在使用这个方法之前,或者建立一个新文档或者打开一个已经存在的新文档.
如果MapControl传给方法,MXD文档将要被IMapControl2::Map代替.