Previous Document Next Document
Shapes.Range

Function Range(IndexArray() As Variant) As ShapeRange

Member of Shapes

The Range method returns a ShapeRange object that contains all of the specified shapes from the collection.

This method accepts a variable number of arguments. It also accepts arrays.

Parameters
Description
IndexArray
Represents index numbers that identify specific shapes

The following code example deletes a range of shape objects from the active document. The first (1) and the fourth (4) shape objects are deleted from the Shapes collection. A message box displays the number of shapes in the collection before and after the deletion, so as to confirm that the shapes were removed from the Shapes 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.