This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Get PageLayout from ArcMap Snippet (ArcObjects .NET 10.4 SDK) |
Get PageLayout from ArcMap.
///<summary>Get PageLayout from ArcMap</summary> /// ///<param name="application">An IApplication interface that is the ArcMap application.</param> /// ///<returns>An IPageLayout interface.</returns> /// ///<remarks></remarks> public ESRI.ArcGIS.Carto.IPageLayout GetPageLayoutFromArcMap(ESRI.ArcGIS.Framework.IApplication application) { if(application == null) { return null; } ESRI.ArcGIS.ArcMapUI.IMxDocument mxDocument=((ESRI.ArcGIS.ArcMapUI.IMxDocument)(application.Document)); // Explicit Cast ESRI.ArcGIS.Carto.IPageLayout pageLayout=mxDocument.PageLayout; return pageLayout; }
'''<summary>Get PageLayout from ArcMap</summary> ''' '''<param name="application">An IApplication interface that is the ArcMap application.</param> ''' '''<returns>An IPageLayout interface.</returns> ''' '''<remarks></remarks> Public Function GetPageLayoutFromArcMap(ByVal application As ESRI.ArcGIS.Framework.IApplication) As ESRI.ArcGIS.Carto.IPageLayout If application Is Nothing Then Return Nothing End If Dim mxDocument As ESRI.ArcGIS.ArcMapUI.IMxDocument=(CType(application.Document, ESRI.ArcGIS.ArcMapUI.IMxDocument)) ' Explicit Cast Dim pageLayout As ESRI.ArcGIS.Carto.IPageLayout=mxDocument.PageLayout Return pageLayout End Function