Previous Document Next Document
ShapeRange.Cut

Sub Cut()

Member of ShapeRange

The Cut method copies all of the shapes in the range to the Clipboard and deletes the copied shapes from the document.

The following code example creates a rectangle and an ellipse on the active page. It then adds a new page, cuts the shapes from the first page, and pastes them in the new page.

Sub Test() 
 Dim p1 As Page, p2 As Page 
 Dim s As Shape 
 Dim doc As Document 
 Set doc = ActiveDocument 
 Set s = doc.ActiveLayer.CreateRectangle(2, 2, 4, 4) 
 Set s = doc.ActiveLayer.CreateEllipse(1, 2, 3, 4) 
 For Each p1 In doc.Pages 
  p1.Activate 
  p1.Shapes.All.Cut 
  Set p2 = doc.AddPages(1) 
  p2.ActiveLayer.Paste 
 Next p1 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.