有谁知道如何在PowerPoint演示文稿(2010)中保存幻灯片的背景图像。这是我的代码的一部分,我试图清除幻灯片以获取背景图像,但这并不是理想的结果
PowerPoint.Presentation p = app.Presentations.Open(slidesContainerPath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);
string imagename;
foreach (PowerPoint.Slide s in p.Slides) {
imagename = s.SlideIndex.ToString() + ".jpg";
s.BackgroundStyle = Microsoft.Office.Core.MsoBackgroundStyleIndex.msoBackgroundStyleNotAPreset;
foreach(Microsoft.Office.Interop.PowerPoint.Shape shape in s.Shapes)
{
shape.Delete();
}
s.Export(imagesContainerPath + "\\" + imagename, "JPG");
}
if (p != null) {
p.Close();
}