Previous Document Next Document

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


ShapeRange.Cut

Sub Cut()

Description

Member of ShapeRange

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

VBA example

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