Is there a way to get rid of the dotted line? I'm trying to get a landscape layout but there's that leftover portrait dotted line.
I don't know what it's called. Apparently, it's not the MapFrame. See dotline.jpg below.
Dim doc As IDocument = New MxDocument
Dim pMxDocument As IMxDocument = doc
m_application = doc.Parent
m_application.Visible = True
m_appHWnd = m_application.hWnd
pMxDocument.ActiveView = pMxDocument.PageLayout
pMxDocument.PageLayout.Page.Orientation = 2
Dim GC As IGraphicsContainer = TryCast(pMxDocument.PageLayout, IGraphicsContainer)
Dim pElement As IElement = GC.FindFrame(pMxDocument.FocusMap)
Dim pMapFrame As IMapFrame = GC.FindFrame(pMxDocument.FocusMap)
pMapFrame.RemoveAllLocatorRectangles()
GC.DeleteElement(pMapFrame)
GC.DeleteAllElements()
Dim pEnvelope As IEnvelope = New Envelope
pEnvelope.PutCoords(1, 1, 10, 7.5)
pElement.Geometry = pEnvelope
GC.AddElement(pElement, 0)
pMxDocument.UpdateContents()
pMxDocument.ActiveView.Refresh()