Previous Document Next Document
ShapeRange.Remove

Sub Remove(Index As Long)

Member of ShapeRange

The Remove method removes a specified shape from the range.

The shape is removed only from a specific range object and not from any other ranges of which it may be a part.

The shape is not deleted from the document.

Parameters
Description
Index
Represents the index number of the shape to be removed from the range

The following code 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.