none
How to save a single powerpoint slide as a file using VSTO RRS feed

  • Question

  • I want to save a Slide object to a file using VSTO. Unfortunately the slide object is non-serializable so i cannot use the standard way to save an object to a file. I tried it with the xmlserializer but no result i get keeping errors complaining that the Microsoft.Office.Interop.PowerPoint.Slide object cannot be serialized.

     I want the current slide to be saved, this could also be as a separate pptx file with just the one slide. Any C# samples will be greatly appreciated.
    Saturday, April 23, 2011 9:42 PM

All replies

  • I don't think PowerPoint has anything in its object model that will let you save a single slide. But you might want to check with the PowerPoint specialists on "Answers" about that (http://answers.microsoft.com/en-us/office/forum/powerpoint?page=1).

    The only possibility I can see is to COPY the slide to the Clipboard, create a new presentation, then PASTE the slide into that presentation (and delete any other slide(s)). Save that presentation to a file.

    For copying, you'd use something like pptPresenation.Slides[index].Copy(); and for pasting pptNewPresentation.Slides.Paste();

    Generally, Office objects aren't serializable...


    Cindy Meister, VSTO/Word MVP
    Sunday, April 24, 2011 5:06 AM
    Moderator