C# PowerPoint以编程方式获取当前文件名并保存
我试图以编程方式将当前打开的powerpoint保存为WMF文件 我似乎不知道怎么做 到目前为止,我掌握的代码是:C# PowerPoint以编程方式获取当前文件名并保存,c#,powerpoint,C#,Powerpoint,我试图以编程方式将当前打开的powerpoint保存为WMF文件 我似乎不知道怎么做 到目前为止,我掌握的代码是: // Create the reference variables PowerPoint.Application ppApplication = null; PowerPoint.Presentations ppPresentations = null; PowerPoint.Presentation ppPresen
// 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实例,创建一个空白的Powerpoint文件并保存它。。。这几乎是我想要的,除了我想要它只是为了保存当前打开的文件
有人能帮忙吗
谢谢激活Application.ActivePresentation.SaveAs(…)后,请尝试使用它。此外,.ppSaveAsWMV也没有出现在MSDN上的.SaveAs的引用中(无论如何,2013年第页)。可能是这个位置。非常感谢。感谢大家对pp2013的了解,对wmvI的支持也发现了这一点。这对我很有帮助。希望对您有所帮助。根据PPT VBA IDE中的对象浏览器:Const ppSaveAsWMV=37(&H25)(PowerPoint.PpSaveAsFileType的成员)。