Home/ Reference/ Application

app.OpenDocument(path)

Opens a .cdr or template file from disk and returns the Document.

Signature

app.OpenDocument(path)

Notes

Opens a .cdr or template file from disk and returns the Document.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
path = "D:/artwork/template.cdr"            # forward slashes work on Windows too

try:
    doc = app.OpenDocument(path)       # open it and return the document
    print("Opened: ", doc.FileName)
except Exception as e:
    print("Open failed, check that the path exists: ", e)

About this section: Application

Application — the CorelDRAW application object.

Other entries in this section