且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将形状从一张幻灯片复制到另一张幻灯片?

更新时间:2023-02-14 10:33:40

我还是不太确定这里的要求.

I am still quite unsure about the requirement here.

pp.Presentation PPT1 = pptApp.Presentations["Presentation1"]; //get the PPT1 object

pp.Presentation PPT2 = pptApp.Presentations["Presentation2"]; // get the PPT2 object
pp.Slide ppt2ActiveSlide = PPT2.Slides[pptApp.ActiveWindow.Selection.SlideRange.SlideIndex]; // returns the active slide of PPT2

// This for loop will loop through all the slides and paste it in the Active Slide of PPT2
foreach(pp.Slide slide in PPT1.Slides)
{
 foreach(pp.Shape shp in slide.Shapes)
  {
   shp.Copy();
   ppt2ActiveSlide.Shapes.Paste();
  }
}



希望对您有所帮助.



Hope it helped.