我试图以编程方式将当前打开的PowerPoint作为WMF文件保存。PowerPoint以编程方式获取当前文件名并将其保存
我似乎无法找出如何做到这一点?
我到目前为止的代码是:
// 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);
但这个代码似乎火了简报的新实例,创建一个空白的PowerPoint文件,并保存...这几乎是我想要的,除了我想它只是为了保存当前打开的文件。
任何人都可以帮忙吗?
感谢
也许这个http://support.microsoft.com/kb/316126 – Jonesopolis