| |
Private Sub FindCoords()
Dim pMxdoc As IMxDocument
Set pMxdoc = ThisDocument
Dim pMap As IMap
Set pMap = pMxdoc.FocusMap
Dim pAct As IActiveView
Set pAct = pMap
Dim pEnv As IEnvelope
Set pEnv = pAct.Extent
Dim xMin As Double
Dim yMin As Double
Dim xMax As Double
Dim yMax As Double
xMin = pEnv.xMin
yMin = pEnv.yMin
xMax = pEnv.xMax
yMax = pEnv.yMax
Dim strBottomLeft As String
strBottomLeft = xMin & "," & yMin
Dim strBottomRight As String
strBottomRight = xMax & "," & yMin
Dim strTopLeft As String
strTopLeft = xMin & "," & yMax
Dim strTopRight As String
strTopRight = xMax & "," & yMax
End Sub |