This tip demonstrates some simple code for zooming in a fixed amount on the data being displayed in the Preview window of ArcCatalog.
How to use
- Paste this macro into VBA.
- Preview a geographic dataset.
- Run this macro.
Public Sub ZoomIn()
Dim pApp As IGxApplication
Set pApp = Application
If Not TypeOf pApp.View Is IGxPreview Then Exit Sub
Dim pPreview As IGxPreview
Set pPreview = pApp.View
If Not TypeOf pPreview.View Is IGxGeographicView Then Exit Sub
Dim pGeoView As IGxGeographicView, pActiveView As IActiveView, pExtent As IEnvelope
Set pGeoView = pPreview.View
Set pActiveView = pGeoView.Map
Set pExtent = pActiveView.Extent
pExtent.Expand 0.75, 0.75, True
pActiveView.Extent = pExtent
pActiveView.Refresh
End Sub