Previous Document Next Document
ShapeRange.RemoveAll

Sub RemoveAll()

Member of ShapeRange

The RemoveAll method removes all shapes from the range.

The shapes are removed only from a specific range object and not from any other ranges of which they may be a part.

The shapes are not deleted from the document.

The following code 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 2007 Corel Corporation. All rights reserved.