【问题标题】:How can I copy shapes from one slide to another slide in c#?如何在 C# 中将形状从一张幻灯片复制到另一张幻灯片?
【发布时间】:2011-08-10 02:10:28
【问题描述】:

我需要将形状从presentation1 插入到presentation2。我们可以像

这样插入幻灯片

pptApp.Presentations[Presentation2].Slides.InsertFromFile("presenation1", 10,2,2);

但我只想将 Presentation1.slide(x) 中的形状插入到 Presentation2.slide(y)。

我如何在 C# 中做到这一点?请帮帮我。

谢谢 P2000

【问题讨论】:

  • 你知道如何得到一个形状吗?如果是这样,只需在其上执行 .Duplicate 并粘贴到 Presentation2 中。
  • 请告诉我从presentation1中获取形状并复制到ppt2中的方法。谢谢

标签: c# powerpoint shapes


【解决方案1】:
var origSlide = origPres.Slides[slideNum];
var destSlide = newPres.Slides[slideNum];
foreach (Shape origShape in origSlide.Shapes)
{
    origShape.Copy();
    newPres.Slides.Paste(slideNum);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-24
    • 2021-01-17
    • 1970-01-01
    • 2020-03-18
    相关资源
    最近更新 更多