I work with several MXD files. When opening those MXD files, i want to see the whole layout view, as this button function: enter image description here.

Is there a way, using arcpy, zooming to the whole page in the layout view, so in the next time i will open those MXD files, the default will be the layout view, zooming to the whole page?

I started to write this code, but i don't know how to continue with it:

import arcpy,os,sys,string
import arcpy.mapping
from arcpy import env

env.workspace = r"G:\desktop\Project"
for mxdname in arcpy.ListFiles('*.mxd'):
     print mxdname
     mxd = arcpy.mapping.MapDocument(r"G:\desktop\Project\\" + mxdname)
     df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] 
     print 'PAGE_LAYOUT'
del  mxd

This code don't zooming to the whole page, but change from data view to layout view, and that isn't my complete goal.

1 Answer 1


I am afraid this is not exposed via arcpy. You will need either to write a .NET/Java add-in or call ArcObjects from Python using comtypes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.