Correcting Powerpoint 2007 XML Errors

1.4k views Asked by At

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.

1

There are 1 answers

4
Todd Main On BEST ANSWER

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.