如何在c#中将形状从一张幻灯片复制到另一张幻灯片? [英] How can I copy shapes from one slide to another slide in c#?
本文介绍了如何在c#中将形状从一张幻灯片复制到另一张幻灯片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从presentation1到presentation2插入形状。我们可以插入一张
I need to insert shape(s) from presentation1 to presentation2. We can insert a slide like
pptApp.Presentations [Presentation2] .Slides.InsertFromFile( presenation1,10,2,2);
pptApp.Presentations[Presentation2].Slides.InsertFromFile("presenation1", 10,2,2);
但是我只希望从Presentation1.slide(x)到Presentation2.slide(y)插入形状。
But I want only the shapes from Presentation1.slide(x) inserted to Presentation2.slide(y).
我该怎么做在C#中?请帮助我。
How can i Do this in C#? Please help me.
感谢
P2000
Thanks P2000
推荐答案
var origSlide = origPres.Slides[slideNum];
var destSlide = newPres.Slides[slideNum];
foreach (Shape origShape in origSlide.Shapes)
{
origShape.Copy();
newPres.Slides.Paste(slideNum);
}
这篇关于如何在c#中将形状从一张幻灯片复制到另一张幻灯片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文