app.Documents
Collection of every open document. The i-th one is app.Documents.Item(i); the total is app.Documents.Count.
Signature
app.Documents
Notes
Collection of every open document. The i-th one is
app.Documents.Item(i); the total is app.Documents.Count.Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
docs = app.Documents # collection of all open documents
print("Open documents: ", docs.Count) # Count = number of elements
for i in range(1, docs.Count + 1): # note: CorelDRAW collections are 1-based
d = docs.Item(i) # d : the i-th Document object
print(i, d.FileName or "unsaved new document")
About this section: Application
Application — the CorelDRAW application object.
- This section has 13 entries; this is one of them.
- See the full section index: Application
Other entries in this section
- app.ActiveDocumentThe document in front. Returns None when nothing is open, so wrap it i
- app.CreateDocument()Creates a blank document and returns it.
- app.OpenDocument(path)Opens a .cdr or template file from disk and returns the Document.
- app.ActiveSelectionRange(n)The n-th shape in the current selection, as a single Shape. Use it to
- app.ActiveSelectionRangeWith no argument it returns the whole selection as a ShapeRange. Itera
- app.ActiveShapeThe first shape in the selection. Same as ActiveSelectionRange(1).
- app.ActivePageThe active page. Shorthand for ActiveDocument.ActivePage.
- app.ActiveLayerThe active layer. Shorthand for ActiveDocument.ActivePage.ActiveLayer.