How to change the Index of slides in powerpoint presentation?

I have developed an application in ASP.net and have used syncfusion to control powerpoint. Now i have generated a presentation and I want to change the order of the slides. Is there any functionality in syncfusion which allows me to do so? If yes, kindly let me know how can I change the index of slides in an existing presentation?


1 Reply

MN Meikanda Nayanar Syncfusion Team February 2, 2018 10:09 AM UTC

Hi Ishan, 
Thank you for contacting Syncfusion support. 
We can change the slide order in a PowerPoint Presentation with the below code snippet. In this code snippet, we have swapped the positions of slide 3 and 2.   
//Open an existing Presentation    
IPresentation presentation = Presentation.Open("Sample.pptx");               
//Clone the slide to which we need to change the position. Here we have cloned the slide at index position 2  
ISlide slide = presentation.Slides[2].Clone();               
//Insert the cloned slide in the required index position   
presentation.Slides.Insert(1, slide);               
//Remove the existing slide which we have inserted in another position. Now its position in the presentation will be incremented, because we have inserted the same slide in a previous position 
presentation.Slides.RemoveAt(3);               
//Save the Presentation in file system   
presentation.Save("Output.pptx");   
 

Please find the complete sample in below link,   
Please let us know if you need any further assistances in this. 
Thanks, 
Meikandan 


Loader.
Up arrow icon