Home/ Reference/ Document

doc.Close()

Closes the document. With unsaved changes it may raise a dialog and stall the script, so doc.Save() first in batch code.

Signature

doc.Close()

Notes

Closes the document. With unsaved changes it may raise a dialog and stall the script, so doc.Save() first in batch code.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
doc.Save()                              # save first so the close prompt cannot block the script
doc.Close()                             # close the document only, keep CorelDRAW alive

print("Document closed, remaining: ", app.Documents.Count)

About this section: Document

Document — documents and file handling.

Other entries in this section