none
Display result from PresentationDocument in PowerPoint by using Memory Stream RRS feed

  • Question

  • I am really new in this and my english ist not the best, so please be patient if I do mistakes. I am programming an AddIn for PowerPoint with C#.

     

    I have a Class, which reads via FileStream my pptx-file.

    My next step is to convert it to a byte[] to have the ability to store it on my database (SQLite) and there i can read it back as byte[], so that I can convert it

    as a MemoryStream in order to manipulate the Presentation with Open XML. 

    My problem is that I want to show the manipulation of the pptx-file in PowerPoint without saving it temporarily and then load it back:

    My workaround  saves the Stream as a pptx-file "tmp.pptx" and with 

    Globals.ThisAddIn.Application.Presentations.Open("C:\\tmp.pptx", Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue);

    i read it back in PowerPoint.

     

    Is there a way in Open XML to show the manipulation directly in PowerPoint so that the user using PowerPoint AND Open XML can manipulate simultaneously the stream?

    My suggestion ist "no", but if it is not possible, can I show and edit my pptx-File directly through using my MemoryStream / byte[]?

     

    Thank you a lot for your help :)

    Wednesday, September 15, 2010 12:47 PM

Answers

  • Hi,

    You can't modify the document using Open XML SDK if it is open. Basically you can get the stream and work on it using Open XML SDK and save it back as a new document/replace the original document.

    Have a look : http://blogs.msdn.com/b/ericwhite/archive/2008/12/10/working-with-in-memory-open-xml-documents.aspx

    Thanks
    Ankush


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Ankush Microsoft Online Community Support
    • Proposed as answer by Ankush_Bhatia Thursday, September 16, 2010 9:38 AM
    • Marked as answer by Bessie Zhao Monday, October 11, 2010 10:14 AM
    Thursday, September 16, 2010 9:38 AM