如何使用c#从PowerPoint中删除幻灯片?

如何使用c#从PowerPoint中删除幻灯片?,c#,interop,powerpoint,C#,Interop,Powerpoint,我想使用C#从PowerPoint演示文稿中删除特定幻灯片。有人能帮我解决这个问题吗?打开PowerPoint stack,然后按普通COM使用 var powerPoint = new Microsoft.Office.Interop.PowerPoint.Application(); var presentation = powerPoint.Presentations.Open(fileName); presentation.Slides[x].Delete(); presentatio

我想使用C#从PowerPoint演示文稿中删除特定幻灯片。有人能帮我解决这个问题吗?

打开PowerPoint stack,然后按普通COM使用

var powerPoint = new Microsoft.Office.Interop.PowerPoint.Application();
var presentation = powerPoint.Presentations.Open(fileName);

presentation.Slides[x].Delete();
presentation.Save();

你可能想看看。它提供了大量用于与Office文件格式交互的库。

我建议查看FileHelpers库,但我不确定它们是否有助于PowerPoint。