Understanding the CorelDRAW object model : Working with pages : Deleting pages |
You can delete a page by using its Delete method, as in the following VBA example:
ActivePage.Delete |
The Page.Delete method deletes all shapes on that page, deletes the page from the Pages collection for that document, and then updates that collection to reflect the change.
If you want to delete more than one page, you must use the Delete method for each unwanted page. However, you cannot delete all pages in a document. You can avoid trying to delete the last remaining page in a document by using the following VBA code:
If ActiveDocument.Pages.Count > 1 Then ActivePage.Delete |
If you want, you can use event handlers to respond to events that are triggered by deleting a page:
• |
Document.PageDelete
|
Copyright 2013 Corel Corporation. All rights reserved.