简体   繁体   English

PowerPoint 幻灯片 xml 无法在 PowerPoint 中打开

[英]PowerPoint slide xml doesn't open in PowerPoint

I am trying to automatically populate PowerPoint slides by replacing values in the xml file.我试图通过替换 xml 文件中的值来自动填充 PowerPoint 幻灯片。 In order to do so I have renamed my .pptx file to a .zip file and have extracted the slide.xml.为此,我将我的 .pptx 文件重命名为 .zip 文件并提取了 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.但是,当我双击它时,它不会在 PowerPoint 中打开,而是在显示原始 xml 代码的 Internet Explorer 中打开。 I found an example online which I can easily open in PowerPoint.我在网上找到了一个可以在 PowerPoint 中轻松打开的示例。 The difference seems to be the version of Powerpoint.区别似乎是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.我不明白为什么我的没有 mso 应用程序。 I'm using Microsoft Office 365 Pro Plus.我正在使用 Microsoft Office 365 专业增强版。

Is there a way to open my xml file in PowerPoint?有没有办法在 PowerPoint 中打开我的 xml 文件? 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.否则我必须解压缩所有内容,替换 xml 文件,再次压缩所有内容并将其转换为 pptx,这会在我的工作流程中创建许多额外的步骤。

A PowerPoint file is a ZIP file that contains a wide variety of XML and other individual files. PowerPoint 文件是一个 ZIP 文件,其中包含各种 XML 和其他单个文件。 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).如果您使用 Windows,您可以通过安装 7-Zip 来节省很多步骤,7-Zip 是一个免费的 zip 实用程序,它也了解如何直接打开 PPTX,就好像它们是 ZIP 文件(当然是 ZIP 文件)。 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.完成后,您可以在 7-Zip 中打开 PPTX 文件,选择要编辑的单个 XML 文件,然后直接在您选择的编辑器中打开它。 When you save from the editor, 7-zip will offer to save the edited file back into the ZIP/PPTX file.当您从编辑器保存时,7-zip 将提供将编辑后的文件保存回 ZIP/PPTX 文件的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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