I am having trouble zooming to a selected point. My code selects the point just fine, but the code I used to zoom to a selected polygon does not work when I try applying it to a point. I have separate buttons in my project, one executes the zoom to a selected polygon, while the other button is designed to execute a zoom to a selected point. Any ideas?
' Now do the zoom to the selected features
Dim pSelSet As ISelectionSet
Set pSelSet = pFeatureSelection.SelectionSet
Dim pEnumGeom As IEnumGeometry
Dim pEnumGeomBind As IEnumGeometryBind
Set pEnumGeom = New EnumFeatureGeometry
Set pEnumGeomBind = pEnumGeom
pEnumGeomBind.BindGeometrySource Nothing, pSelSet
Dim pGeomFactory As IGeometryFactory
Set pGeomFactory = New GeometryEnvironment
Dim pGeom As IGeometry
Set pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom)
pMxDoc.ActiveView.Extent = pGeom.Envelope
pFeatureSelection.Clear
pMxDoc.ActiveView.Refresh
pMxDoc.PageLayout.ZoomToWhole
Thanks,
Michael