首页/ 接口索引/ Application 应用对象

app.Documents

所有已打开文档的集合。取第 i 个:app.Documents.Item(i),共 app.Documents.Count 个。

签名

app.Documents

说明

所有已打开文档的集合。取第 i 个:app.Documents.Item(i),共 app.Documents.Count 个。

Python 示例(可直接运行)

依赖 pywin32。示例假定 app / doc / page / layer 已就绪。 见「连接与初始化」
Python
docs = app.Documents                    # 所有已打开文档的集合
print("打开文档数:", docs.Count)        # Count = 元素个数

for i in range(1, docs.Count + 1):      # 注意:CDR 集合索引从 1 开始
    d = docs.Item(i)                    # d : 第 i 个文档对象
    print(i, d.FileName or "未保存的新文档")

关于本类:Application 应用对象

整个 CDR 进程的入口,主要用来拿文档、拿当前选中、建颜色。

同类其他接口