What ArcObjects are involved in making "Fit to Margins" work for a given Page Layout?
Easier to see from picture below:
Here is my code that got me the answer - basically it was a case of matching up the coordinates in the 2 corners of UpperRight and LowerLeft:
IPageLayout pageLayout = mxDocument.PageLayout;
pageLayout.Page.FormID = esriPageFormID.esriPageFormCUSTOM;
pageLayout.Page.PutCustomSize(31.75, 15.88);
IActiveView activeView = pageLayout as IActiveView;
IEnvelope env = activeView.Extent;
IGraphicsContainer graphicsContainer = pageLayout as IGraphicsContainer;
graphicsContainer.Reset();
IElement element = graphicsContainer.Next();
//Enumerate through the graphics container, finding all MapSurroundFrames.
while (element != null)
{
if (element is IFrameElement)
{
IPoint lowerLeftPoint = new PointClass();
lowerLeftPoint.X = 0;
lowerLeftPoint.Y = 0;
env.LowerLeft = lowerLeftPoint;
IPoint upperRightPoint = new PointClass();
upperRightPoint.X = 31.75;
upperRightPoint.Y = 15.88;
env.UpperRight = upperRightPoint;
element.Geometry = env;
}
element = graphicsContainer.Next();
}
IPage.PrintableBounds