API Documentation > CorelDRAW > 2025-v26 > ShapeRange > IVGShapeRange
ShapeRange.GetBoundingBox method
Gets the shape range bounding box relatively to its lower left corner
Syntax:
Sub GetBoundingBox(ByRef x As Double, ByRef y As Double, ByRef Width As Double, ByRef Height As Double, Optional ByVal UseOutline As Boolean = False)
Parameters:
Name Type Description
x
Double
y
Double
Width
Double
Height
Double
UseOutline
Boolean
Specifies whether outlines are considered when calculating the size of the bounding box. If this value is set to True, shape outlines are taken into account when calculating the dimensions of the bounding box; otherwise, the shapes are treated as though they have no outline.
Remarks:
The GetBoundingBox method returns the position of the lower-left corner of all the objects in a shape range, treating the range as a single shape. It also returns the total size of all the shapes in the range. See also the ShapeRange.PositionX, ShapeRange.PositionY, ShapeRange.SizeWidth, and ShapeRange.SizeHeight properties, as well as the ShapeRange.GetPosition, ShapeRange.SetPosition, ShapeRange.GetSize, ShapeRange.SetSize, ShapeRange.SetSizeEx, and ShapeRange.Move methods.
Examples:
The following VBA example creates a rectangle that surrounds an ellipse.
Sub Test()
Dim s As Shape
Dim sr As ShapeRange
Dim x As Double, y As Double, w As Double, h As Double
Set s = ActiveLayer.CreateEllipse(1, 2, 3, 4)
ActiveDocument.ReferencePoint = cdrCenter
Set sr = ActivePage.Shapes.All
sr.GetBoundingBox x, y, w, h
ActiveLayer.CreateRectangle2 x, y, w, y 
End Sub