每个 Powerpoint 演示文稿文件(.ppt 或 .pptx)是否有关联的唯一 ID?

Is there any unique ID associated with each Powerpoint presentation file (.ppt or .pptx)?

我查看了 MSDN,在 Presentation 对象模型 ( https://msdn.microsoft.com/EN-US/library/office/ff746640(v=office.15).aspx )

中似乎没有唯一 ID(UUID 或诸如此类)属性

根据代码示例,Presentation 只能通过名称来标识。例如

Presentations("Sample Presentation").Slides.Add 1, 1

我是否可以通过 ID 识别演示文稿?希望它看起来像这样

Presentations("067e6162-3b6f-4abc-a171-2470b63dff00").Slides.Add 1, 1

PowerPoint 对象模型不提供任何特殊 ID。您可以使用 Presentation class 的 FullName 属性 来唯一标识演示文稿。

如果您对该解决方案不满意,您可以考虑将您自己的 ID 添加为自定义文档 属性。 Presentation CustomDocumentProperties 属性 class returns 一个 DocumentProperties 集合,表示指定演示文稿的所有自定义文档属性。