Hi,
After posting this issue:Unable to Remove All Shapes from Presentation Slides,I am confronted with a new problem in removing multiple shapes.
I’m trying to write a piece of code that can remove multiple shapes with the same width and height form all slides.
My code is as follows:
Presentation pres = new Presentation(filename);
for (int islide = 0; islide < pres.Slides.Count; islide++)
{
ISlide slide = pres.Slides[islide];
for (int ishp = 0; ishp < slide.Shapes.Count; ishp++)
{
IShape shp = slide.Shapes[ishp];
if (shp.Height = Convert.ToSingle(Height) & shp.Width = Convert.ToSingle(Width))
{
slide.Shapes.Remove(shp);
}
}
}
I found that when there are multiple shapes with the same height and width, only some(maybe 2 or 3) of them can be deleted and the rest still exist.
Could you please tell me how I can fix this ?
Thanks and Regards