Hi,
I’m trying to clone slides to master slides.
What I want to do in detail is to copy each slide in a source presentation,and then put them as master slides in a target presentation.
I’ve tried the code below to do this.
Presentation targetpres = new Presentation("Put The Path of the Target Presentation Here");
Presentation sourcepres = new Presentation("Put The Path of the Source Presentation Here");
for (var index_src = 0; index_src < sourcepres.Slides.Count; index_src++)
{
ISlide sourceslide = sourcepres.Slides[index_src];
IMasterSlide convert = (IMasterSlide)sourceslide;
targetpres.Masters.InsertClone(index_src, convert);
}
However,it doesn’t work since ISlide can’t be converted to IMasterSlide by using “IMasterSlide convert = (IMasterSlide)sourceslide;”.
Could you please tell me whether it’s possible to clone slides to master slides?
For instance,can I just simply loop through every shape in the source slide and clone them to a newly-created master slide,so that it looks like the source slide is “copied”?