Adding a new slide after current slide

I am able to add a new slide, but it inserts it at the end of the template, is there a way to insert it at x position?

Say insert new slide at page 9 which would then push the next page to 10 etc

Using this to insert a new slide if it changes anything:

var layoutSlide = presentation.MasterSlides[1].LayoutSlides.First(ls => ls.Name == "Title and Content");
var slide = presentation.Slides.AddNew(layoutSlide);

Hi Joseph,

You can use SlideCollection.InsertNew, for example:

var slide = presentation.Slides.InsertNew(3, layoutSlide);

I hope this helps.


Hi Mario,

Thanks for your help, is there a way to find out the current slides index?

Kind regards

Yes, use SlideCollection.IndexOf.