0

I am attempting to programmatically save the currently opened powerpoint as a WMF file.

I cannot seem to find out how to do it...

The code I have so far is:

        // Create the reference variables
        PowerPoint.Application ppApplication = null;
        PowerPoint.Presentations ppPresentations = null;
        PowerPoint.Presentation ppPresentation = null;

        // Instantiate the PowerPoint application
        ppApplication = new PowerPoint.Application();

        // Create a presentation collection holder
        ppPresentations = ppApplication.Presentations;

        // Create an actual (blank) presentation
        ppPresentation = ppPresentations.Add(Office.MsoTriState.msoTrue);

        // Activate the PowerPoint application
        ppApplication.Activate();

        string myFileName = "myPresentation";

        // Save the presentation as a PPTX
        ppPresentation.SaveAs(myFileName, PowerPoint.PpSaveAsFileType.ppSaveAsWMV, Office.MsoTriState.msoTrue);

But this code seems to fire up a new instance of Powerpoint, create a blank powerpoint file and save it... which is almost what I want except I want it just to save the currently opened file.

Can anyone help please?

Thanks

4

1 回答 1

1

激活后尝试 Application.ActivePresentation.SaveAs(...) 。此外, .ppSaveAsWMV 没有出现在 MSDN 上对 .SaveAs 的引用中(无论如何都是 PP 2013)。

于 2013-07-11T12:39:21.873 回答