private static void Cleanup(PPT.Presentation presentation, PPT.Application powerPointApplication) { PptPresentationManager.SavePresentationAs( presentation, Environment.CurrentDirectory + ResourceFolder + OutputFile, PPT.PpSaveAsFileType.ppSaveAsOpenXMLPresentation, true); // Step 100b. Export all slides in the presentation as PNG PptSlideManager.ExportAll( presentation, Environment.CurrentDirectory + ResourceFolder, ImageFormats.Formats.png); PptPresentationManager.ClosePresentation(presentation); PptApplicationManager.ClosePowerPointApplication(powerPointApplication); }