VSTO OpenXml C# - Edit PowerPoint on Runtime

拜拜、爱过 提交于 2021-02-08 07:51:53

问题


I've read a lot about editing pptx files with OpenXml like

PresentationDocument presentationDocument = PresentationDocument.Open("C:\\Users\\beggers\\Desktop\\Test.pptx", true)

But how can I modify the XML data of my slides/presentation on runtime? Specialy when I run a new presentation witch is not saved.

I am working on a C# VSTO Add-in and I want to modify my slide/xml in a way, which is not supportet by Microsoft.Office.Interop.


回答1:


Unfortunately, Microsoft Word is the only Office application that offers an Interop API for reading and even writing Open XML markup, in that case of a given Range object (which can also be the Range representing the whole main document part). Neither Excel nor PowerPoint provides that capability.

Even Microsoft Word does not give you the full markup, though, meaning you can't read or change every aspect of the opened document by reading or making changes to the Open XML markup. Thus, depending on what you would like to do with your document, you will have to close and reopen even Word documents to access and process the full Open XML markup.



来源:https://stackoverflow.com/questions/59293193/vsto-openxml-c-sharp-edit-powerpoint-on-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!