C# 复制 powerpoint 主幻灯片布局

标签 c# powerpoint

我想将主布局从一个演示文稿复制到另一个演示文稿。 如果我想复制幻灯片,代码将为 Presentation.Slides[1].Copy,但是我找不到用于复制主布局的类似代码。有 Presentation.SlideMaster.Delete() 但由于某种原因没有副本。如果在 c# 中不可能,在 vba 中是否可以?

我想基本上实现自动化 this

最佳答案

这是将设计从一个演示文稿复制到另一个演示文稿的 VBA 代码 - http://skp.mvps.org/pptxp018.htm 。在 C# 中也可以实现同样的效果。

Sub CopyDesigns()

    Dim oSourceDesigns As Presentation
    Dim I As Integer
    Set oSourceDesigns = Presentations.Open("K:\Docs\main.pot", , , False)
    
    For I = 1 To oSourceDesigns.Designs.Count
        ActivePresentation.Designs.Clone oSourceDesigns.Designs(I)
    Next I
    
    oSourceDesigns.Close
    Set oSourceDesigns = Nothing

End Sub

关于C# 复制 powerpoint 主幻灯片布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40863326/

相关文章:

python - 如何在 ppt 中嵌入 python 图表(或图像)并刷新它

c# - HttpResponseMessage.Content.ToString();返回为 System.Net.Http.SteamContent

c# - 如何从 x64 构建应用程序?

java - 使用 Apache POI 设置 PowerPoint 文档中圆角矩形的半径

vba - 在双显示器系统中,找出在哪个显示器上显示 PowerPoint 幻灯片

vba - 对象 'Activate' 的偶尔 VBA 方法 'ChartData' 失败

c# - 从常规注释生成 XML 注释

c# - Monotouch 绑定(bind)到 Cordova 时出现问题(NSInvalidArgumentException)

c# - 嵌套模型上的 nullReferenceException

powerpoint - 使用Open Office SDK 2.0将PowerPoint 2007保存为PowerPoint 2003