HOW TO
This article contains a code sample that shows how to zoom out on the dataframe using VBA.
Note:
Code in the Project's ThisDocument code module will only run in the current map document. If you want to store the code in all your map documents open the Normal.mxt ThisDocument code module instead.
Code:
Sub zoomout()
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
Dim pExtentEnv As IEnvelope
Set pMxDoc = ThisDocument
Set pActiveView = pMxDoc.ActiveView
Set pExtentEnv = New Envelope
Set pExtentEnv = pActiveView.Extent
'the following line will double the extent
pExtentEnv.Expand 2, 2, True
pActiveView.Extent = pExtentEnv
pActiveView.Refresh
End Sub
Get help from ArcGIS experts
Download the Esri Support App