Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed May 27, 2020 5:34 pm

Hello!
Could you please assist me.
I need delete all shapes from Layout slide.

ppt.Slides[0].Layout

How can I do it ?

Thanks...
Oleg.

kantalsoft2
 
Posts: 2
Joined: Wed May 27, 2020 5:29 pm

Thu May 28, 2020 3:58 am

Hello,

Thanks for your inquiry.
Please refer to the code below. If this is not what you want, please provide us with your input file as well as your desired output. Then we will investigate further.
Code: Select all
    //Create a PPT document
    Presentation presentation = new Presentation();
    //Load doucment from disk
    presentation.LoadFromFile("sample.pptx");
    //Get the layout slide
    ActiveSlide lslide = presentation.Slides[0].Layout as ActiveSlide;
    //Remove all the shape
    for (int j = 0; j < lslide.Shapes.Count; j++)
    {
        IShape shape = lslide.Shapes[j];
        lslide.Shapes.Remove(shape);
        j--;             
    }
    presentation.SaveToFile("out.pptx", FileFormat.Pptx2013);


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu May 28, 2020 5:33 am

That is what I need!
Thank you!

kantalsoft2
 
Posts: 2
Joined: Wed May 27, 2020 5:29 pm

Thu May 28, 2020 6:21 am

Hello,

Thanks for your prompt response.
If you need further assistance, just feel free to contact us.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Presentation