简体   繁体   中英

PowerPoint slide xml doesn't open in PowerPoint

I am trying to automatically populate PowerPoint slides by replacing values in the xml file. In order to do so I have renamed my .pptx file to a .zip file and have extracted the slide.xml. However, when I double click on it, it won't open in PowerPoint, but in Internet Explorer which displays the raw xml code. I found an example online which I can easily open in PowerPoint. The difference seems to be the version of Powerpoint.

Here are the first few lines of my file:

<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"><a:extLst><a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{AC066BBA-CB4D-4949-AA5A-21A42A204D8A}"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ctrTitle"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>new test</a:t></a:r><a:endParaRPr lang="en-GB"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Subtitle 2"><a:extLst><a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{AB8B74CA-61F0-4C5B-A472-D0F4C1A1816C}"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="subTitle" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-GB"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3906227250"/>

And this is what the example looks like:

<?mso-application progid="PowerPoint.Show"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">

I don't understand why mine doesn't have mso-application. I'm using Microsoft Office 365 Pro Plus.

Is there a way to open my xml file in PowerPoint? Otherwise I have to unzip everything, replace the xml file, zip everything again and convert it to pptx which creates a lot of extra steps in my workflow.

A PowerPoint file is a ZIP file that contains a wide variety of XML and other individual files. It won't open any one of those individual files directly.

Despite the extra steps, unzipping/editing/rezipping is exactly what you'll have to do.

If you use Windows, you can save a LOT of steps by installing 7-Zip, a free zip utility that also understands how to open PPTX directly as though they were ZIP files (which of course they are). And you can tell it what editor you want to use; once you've done that, you can open a PPTX file in 7-Zip, choose the individual XML file you want to edit and have it open directly into your chosen editor. When you save from the editor, 7-zip will offer to save the edited file back into the ZIP/PPTX file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM