﻿ Rectangle Example
Rectangle Example

#### Description

Gets the map extent (a Rectangle) and displays information about its properties in a message box.

#### VBScript Code

Copy Code
``` Sub GetMapExtent
Dim objExtentRect
'Get the map extent
Set objExtentRect = Application.Map.Extent
'Display the rectangle's information
MsgBox "Map Extent Geometry:" & VBCr &_
"Bottom: " & CStr(objExtentRect.Bottom) & VBCr &_
"Top: " & CStr(objExtentRect.Top) & VBCr &_
"Left: " & CStr(objExtentRect.Left) & VBCr &_
"Right: " & CStr(objExtentRect.Right) & VBCr &_
"Floor: " & CStr(objExtentRect.Floor) & VBCr &_
"Ceiling: " & CStr(objExtentRect.Ceiling) & VBCr &_
"Min. Measure: " & CStr(objExtentRect.MinimumMeasure) & VBCr &_
"Max. Measure: " & CStr(objExtentRect.MaximumMeasure) & VBCr &_
"Center: " & CStr(objExtentRect.Center.X) & ", " & CStr(objExtentRect.Center.Y) & VBCr &_
"Map Extent Dimensions:" & VBCr &_
"Width: " & CStr(objExtentRect.Width) & VBCr &_
"Height: " & CStr(objExtentRect.Height) & VBCr &_
"Depth: " & CStr(objExtentRect.Depth) & VBCr &_
"Measure Range: " & CStr(objExtentRect.MeasureRange) _
,vbInformation,"Map Extent"
Set objExtentRect = Nothing
End Sub```