The extent stack.
[Visual Basic 6.0] Property ExtentStack As IExtentStack
[Visual Basic .NET] Public ReadOnly Property ExtentStack As IExtentStack
[C#] public IExtentStack ExtentStack {get;}
[Java] public getExtentStack ( IExtentStack ExtentStack )
[C++] HRESULT get_ExtentStack( IExtentStack** ExtentStack );
Returns a reference to the active view's extent stack. Each active view has an extent stack which remembers previous extents so that users can 'go back' and then 'go forward' to previous extents.
The following simple VBA script attempts to set the active view's extent to the previous extent held in the extent stack. Note that IMxDocument::ActiveView is used so that the script works with ArcMap's current view - data or layout. IExtentStack::Undo and Redo automatically call refresh.
Sub PreviousExtent()
Dim pMxDocument As IMxDocument
Dim pPageLayout As IPageLayout
Dim pExtentStack As IExtentStack
Set pMxDocument = Application.Document
Set pExtentStack = pMxDocument.ActiveView.ExtentStack
If pExtentStack.CanUndo Then pExtentStack.Undo
End Sub