API Documentation > CorelDRAW > 2025-v26 > ShapeRange > IVGShapeRange
ShapeRange.SetSize method
Stretches a shape range to fit a specific width and height
Syntax:
Sub SetSize(Optional ByVal Width As Double = 0, Optional ByVal Height As Double = 0)
Parameters:
Name Type Description
Width
Double
Specifies, in document units, the width of the range.
Height
Double
Specifies, in document units, the height of the range.
Remarks:
The SetSize method sets the size of the shapes in a shape range, treating the range as a single object. The reference point around which to stretch the range is specified by the Document.ReferencePoint property. See also the ShapeRange.SizeWidth and ShapeRange.SizeHeight properties, as well as the ShapeRange.GetBoundingBox and ShapeRange.SetBoundingBox methods.
Examples:
The following VBA example stretches all the shapes on the active layer so that the vertical size of each shape is 1.
Sub Test()
Dim x As Double, y As Double
Dim sr As ShapeRange
Set sr = ActiveLayer.Shapes.All
If sr.Count > 0 Then
  ActiveDocument.ReferencePoint = cdrCenter
  sr.GetPosition x, y
  sr.SetSize x, 1
End If 
End Sub