Previous Document Next Document

Understanding the CorelDRAW object model : Working with documents : Closing documents


Closing documents

You can close a document by calling the Document.Close method.

The following VBA code closes the active document and activates the document behind it:

ActiveDocument.Close

 
If the code closes a document that is not active, the document referenced by the Application.ActiveDocument property does not change.
 
You must explicitly test the Dirty property for a document and take appropriate action if that document has been modified.

 
You can also close a document by using the Close method of the Document object itself (as in doc.Close).

If you want, you can use event handlers to respond to events that are triggered by closing a document:

 
Application.DocumentClose
 
Document.Close
 
GlobalMacroStorage.DocumentClose

You can also use event handlers to respond to events that are triggered when the user responds to a request to close a document:

 
Application.QueryDocumentClose
 
Document.QueryClose
 
GlobalMacroStorage.QueryDocumentClose

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.