更正 Powerpoint 2007 XML 错误

发布于 2024-09-15 14:16:06 字数 540 浏览 0 评论 0原文

我目前正在编写一个过程,该过程可以通过 VBScript 使用 MSXML 库从给定模板以编程方式生成 Powerpoint 报告。我对 XML 所做的唯一操作是复制幻灯片、将数据插入到图表的 Excel 数据表中以及一些标题文本文本替换。我正在测试两个模板,它们的图表相同,但样式和布局不同。其中一个模板为我提供了一个工作输出 pptx 文件,而另一个模板在打开时显示此错误:

Powerpoint 错误

现在我想知道找到此错误原因的最佳/最简单方法是什么?我尝试过比较模板、输出和 Powerpoint 的校正输出之间的 XML,但差异出现在许多不同文件的许多不同位置,因此这是一个非常漫长的过程。有没有任何检查/验证工具可以帮助我?我已根据架构检查了 XML,但 XML 似乎是有效的。

我无法升级到 Microsoft 的 OpenXML SDK for .NET 等工具,并且该流程必须在我当前使用的 VBScript/MSXML 流程中实现。

I'm currently writing a process that generates Powerpoint reports programmatically from a given template using the MSXML library via VBScript. The only manipulation of the XML I'm doing is to duplicate slides, insert data into the Excel datatables for charts and a couple of title-text text replacements. I'm testing on 2 templates which are identical in terms of the charts but differ on the styles and layouts. One of the templates gives me a working output pptx file whereas the other shows this error when opened:

Powerpoint error

Now what I want to know is what's the best/easiest way of finding the cause of this error? I've tried diffing the XML between the template, output and Powerpoint's corrected output but differences appear in so many different places in so many different files that it's a very lengthy process. Are there any checking/validation tools that could help me here? I've checked the XML against the schemas but the XML seems to be valid.

I can't upgrade to tools such as Microsoft's OpenXML SDK for .NET and the process must be implemented in the VBScript/MSXML process I'm currently using.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

比忠 2024-09-22 14:16:06

对于 Open XML 文档的基本验证,您可以使用 Open XML SDK。请从以下两个链接开始:

对于非 SDK 验证,主要是手动完成的。 PowerPoint 中的大多数错误与以下内容有关:

  1. 幻灯片布局与
    主幻灯片布局。 <-这个是
    写信时更常见
    不同的模板。
  2. 关系 ID (rId) 不
    匹配。
  3. 中的条目不正确
    [内容类型].xml。

一种技术是在无效的幻灯片平台上选择“修复”,然后用不同的名称保存修复的幻灯片。然后,您可以使用 DiffOPC 工具来运行已修复的工具和有错误的工具来尝试确定修复的内容 - 这通常可以很好地表明最初的问题是什么。

For basic validation of Open XML documents, you can use the Open XML SDK. See these two links as a start:

For non-SDK validation, it is done mostly by hand. Most errors in PowerPoint relate to:

  1. Mismatch between slide layout and
    master slide layout. <- this one is
    more common when writing to
    different templates.
  2. Relationship Ids (rId) don't
    match.
  3. Incorrect entries in
    [Content_Types].xml.

One technique is to choose "Repair" on the invalid slide deck and then save the repaired deck with a different name. You can then use the DiffOPC tool to run against the repaired one and the one with errors to try to determine what was repaired - that will usually be a great indication of what was incorrect in the first place.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文