Previous Document Next Document

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


ShapeRange.RemoveAll

Sub RemoveAll()

Description

Member of ShapeRange

The RemoveAll method removes all shapes from a specified shape range.

 
The specified shapes are removed only from the specified shape range and not from any other ranges of which they may be a part.
 
The specified shapes are not deleted from the document.
VBA example

The following VBA example creates ten circles and randomly places them on a page. It fills them with red and groups them. It then creates 10 more rectangles, fills them with yellow, and groups them.

Sub Test()
 Dim sr As New ShapeRange
 Dim n As Long
 For n = 1 To 10
  sr.Add ActiveLayer.CreateEllipse2(Rnd() * 8, Rnd() * 11, 0.5)
 Next n
 sr.ApplyUniformFill CreateRGBColor(255, 0, 0)
 sr.Group
 sr.RemoveAll
 For n = 1 To 10
  sr.Add ActiveLayer.CreateRectangle2(Rnd() * 8, Rnd() * 11, 1, 1)
 Next n
 sr.ApplyUniformFill CreateRGBColor(255, 255, 0)
 sr.Group
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.