Previous Document Next Document

Object Model Reference : Classes : S : Shapes : Methods : Shapes.Range


Shapes.Range

Function Range(IndexArray() As Variant) As ShapeRange

Description

Member of Shapes

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.

Parameter
Description
IndexArray
Specifies the range of index numbers that identify and group the desired shapes

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.