Office PowerPoint:如何应用我通过ActivePresentation.Designs.Add()创建的新设计

时间:2015-08-15 08:32:08

标签: ms-office powerpoint powerpoint-vba

我正在尝试创建一个新的幻灯片母版并将其应用于当前演示文稿,代码如下:

    var design = app.ActivePresentation.Designs.Add("my own design");
    app.ActivePresentation.Apply??

我尝试过ApplyTheme和ApplyTemplate,它们都抛出异常

System.Runtime.InteropServices.COMException (0x80048240): Presentation (unknown member) : Invalid request.  PowerPoint could not open the file.
   at Microsoft.Office.Interop.PowerPoint.PresentationClass.ApplyTheme(String themeName)

有什么想法吗?提前谢谢。

1 个答案:

答案 0 :(得分:0)

使用:

ActivePresentation.Slides.Range.Design = design