Home/ Reference/ Import / Export

doc.Close()

Closes the document. Unsaved changes raise a dialog that blocks the script — save first.

Signature

doc.Close()

Notes

Closes the document. Unsaved changes raise a dialog that blocks the script — save first.

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
doc.Close()                  # close the document only, keep CorelDRAW alive

print("Closed, documents left: ", app.Documents.Count)

About this section: Import / Export

Import / Export — import, export, save and print.

Other entries in this section