Previous Document Next Document

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


Shapes.AllExcluding

Function AllExcluding(IndexArray() As Variant) As ShapeRange

Description

Member of Shapes

The AllExcluding method returns a shape range that contains all the shapes (except any specified ones) from a Shapes collection.

 
This function 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 all the shapes in the Shapes collection, except the two shapes that were most recently created. To run this example, there must be at least three shapes on the active layer.

Sub Test()
 With ActiveLayer.Shapes
  .AllExcluding(Array(1, 2)).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.