Q:

PowerPoint Programmatically get current filename and save it

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

A:

Try Application.ActivePresentation.SaveAs(...) after you have activated it. Also, .ppSaveAsWMV doesn't show up on the reference to .SaveAs on MSDN (PP 2013 anyway).

