使用 Python 从 PPT 中删除评论和评论作者

使用 Aspose.Slides for Python via .NET 删除演示文稿评论及其关联作者。

通过 Python 从 PPT 中删除评论

Aspose.Slides for Python via .NET 可访问 PPT 演示文稿中存储的评论和评论作者。使用 Presentation 加载文件,清空每位作者的 comments 集合,清空 comment_authors,然后以 PPT 格式保存结果。

使用 Python 从 PPT 中删除评论

with slides.Presentation("presentation.ppt") as presentation:
    for comment_author in presentation.comment_authors:
        comment_author.comments.clear()

    presentation.comment_authors.clear()
    presentation.save("presentation-without-comments.ppt", slides.export.SaveFormat.PPT)

如何通过 Python 从 PPT 中删除评论

按照以下步骤从 PPT 演示文稿中删除所有评论和评论作者。

  1. 安装 Aspose.Slides for Python via .NET。
  2. 使用 Presentation 打开 PPT 文件。
  3. 遍历 comment_authors 并清空每位作者的 comments 集合。
  4. 清空 comment_authors 集合。
  5. 使用 SaveFormat.PPT 调用 save,写入更新后的 PPT 演示文稿。

基于 Aspose.Slides 构建

在线删除 PPT 评论

免费的 Aspose.Slides Annotation 应用基于 Aspose.Slides for Python via .NET 构建,与上方代码使用的是同一 API。打开它,看看 API 能如何处理您自己的 PPT 文件。

  • 在浏览器中运行,无需安装任何软件。
  • 在编写代码之前,先了解 Aspose.Slides 如何删除评论。
  • 删除 PPT 文件中的所有评论。
  • 下载清理后的文件。

批注支持的其他格式

使用 Python,您还可以从其他格式中删除批注。