P2000
P2000

Reputation: 101

How can I copy shapes from one slide to another slide in c#?

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);

But I want only the shapes from Presentation1.slide(x) inserted to Presentation2.slide(y).

How can i Do this in C#? Please help me.

Thanks P2000

Upvotes: 4

Views: 2385

Answers (1)

Arie Livshin
Arie Livshin

Reputation: 885

var origSlide = origPres.Slides[slideNum];
var destSlide = newPres.Slides[slideNum];
foreach (Shape origShape in origSlide.Shapes)
{
    origShape.Copy();
    newPres.Slides.Paste(slideNum);
}

Upvotes: 1

Related Questions