API Documentation > CorelDRAW > 2025-v26 > ShapeRange > IVGShapeRange
ShapeRange.SetSizeEx method
Sets the shape range size using the anchor point
Syntax:
Sub SetSizeEx(ByVal CenterX As Double, ByVal CenterY As Double, Optional ByVal Width As Double = 0, Optional ByVal Height As Double = 0)
Parameters:
Name Type Description
CenterX
Double
CenterY
Double
Width
Double
Specifies the horizontal size of the shape range after the stretch.
Height
Double
Specifies the vertical size of the shape range after the stretch.
Remarks:
The SetSizeEx method sets the size of the shapes in a shape range, treating the range as a single object. You can specify the reference point around which the range is stretched. 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 the shape range on the active layer proportionally, so that its width is 2".
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.SetSizeEx x, y, 2
End If 
End Sub