I've recently begun digging into the OpenXML SDK in hopes of automatically generating a PowerPoint presentation. I found the entire process painful, and have spent the better part of the weekend and the last two days generating a library to sit over the raw SDK calls. Everything seems to be working fine during the generation process, and I can validate the code as correct in the Open XML SDK Productivity Tool. Opening the file in PowerPoint, however, causes a dialog box to appear asking me to fix the file before opening it.
All of this code is refactored from what I reflected out of a file created in PowerPoint. Running a difference against those packages in the Productivity Tool, I find that my slide layouts (except for the first one) are in /ppt/slideLayouts/slideLayouts/
, whereas the correct presentation has them in /ppt/slideLayouts/
. I've triple checked my generating code, and it adds the SlideLayout to the PresentationPart
, not a SlideLayoutPart
. It's especially odd, because the first layout is in the correct location, and the subsequent ones are not.
I've read through the MSDN documentation and the Open XML e-book by Wouter van Vugt. I've compared my code against the reflected code, and it appears correct to me (although I could be missing a lot of things considering how new I am to Open XML and the complexity of PresentationML). Does anyone have any insight into what may be happening here?