Previous Document Next Document

Object Model Reference : Classes : S : ShapeRange : Methods : ShapeRange.DeleteItem


ShapeRange.DeleteItem

Sub DeleteItem(Index As Long)

Description

Member of ShapeRange

The DeleteItem method removes a specified shape from a shape range and deletes it from the document.

Parameter
Description
Index
Specifies the shape by its index number

VBA example

The following VBA example deletes the first shape from the shape range.

Sub Test()
 Dim s As Shape
 Dim sr As ShapeRange
 Set s = ActiveLayer.CreateRectangle(2, 2, 4, 4)
 s.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0)
 Set s = ActiveLayer.CreateRectangle2(1, 4, 5, 5)
 s.Fill.ApplyUniformFill CreateRGBColor(0, 255, 0)
 Set s = ActiveLayer.CreatePolygon(1, 2, 3, 4, 6)
 Set sr = ActivePage.FindShapes(, cdrRectangleShape)
 sr.DeleteItem 1
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.