API Documentation > CorelDRAW > 2025-v26 > ShapeRange > IVGShapeRange
ShapeRange.Remove method
Removes as pecified shape from a the range
Syntax:
Sub Remove(ByVal Index As Long)
Parameters:
Name Type Description
Index
Long
Remarks:
The Remove method removes a specified shape from a shape range. The specified shape is removed only from the specified shape range and not from any other ranges of which it may be a part. The specified shape is not deleted from the document.
Examples:
The following VBA example moves the selected rectangles by 1" to the right. Any other selected shapes that are not rectangles are not moved.
Sub Test()
Dim sr As ShapeRange
Dim i As Long
Set sr = ActiveSelectionRange
For i = sr.Count To 1 Step -1
  If sr(i).Type <> cdrRectangleShape Then sr.Remove i
  Next i
  sr.Move 1, 0

End Sub