API Documentation > CorelDRAW > 2025-v26 > Shapes > IVGShapes
Shapes.Range method
Gets the shape range from index
Syntax:
Function Range(ByRef ParamArray IndexArray() As Variant) As ShapeRange
Parameters:
Name Type Description
IndexArray
Variant
Remarks:
The Range method returns a shape range that contains all the specified shapes from a Shapes collection. This method accepts a variable number of arguments. It also accepts arrays.
Examples:
The following VBA example deletes a shape range from the active document. The first (1) and the fourth (4) shapes are deleted from the Shapes collection. A message box displays the number of shapes in the collection before and after the deletion, to confirm that the shapes were removed from the collection.
Sub ShapesRange()
With ActiveLayer.Shapes
  MsgBox "There are " & .Count & " shapes in the Shapes collection."
  .Range(Array(1, 4)).Delete
  MsgBox "There are " & .Count & " shapes in the Shapes collection."
End With 
End Sub