Hi,
I’m trying to delete a specific Slide in my Document, and it don’t supress the good one.
Let me provide some information because it’s a little bit strange:
If I made by myself (using Microsoft PowerPoint) a PowerPoint Document with 24 Slides, and I choose to delete the first slide I use this command
Presentation pres = … pres.Slides.RemoveAt(0); |
Now I decide to delete the last Slide, so I use
Presentation pres = … pres.RemoveAt(pres.Slides.LastSlidePosition-1); |
But If I provide a different document, one from a ASPOSE generation, It doesn’t work, and it delete for the first case the 21th slide and for the second case the 4th slide. Very Strange
I provide you my PowerPoint Document generated by my Visual Solution based on ASPOSE.PowerPoint v 2.0.5.1
After testing differents position to delete I obtain this result (I based my test on my PowerPoint Generated with 24 Slides):
[Position specified] [Slide Deleted] [ 0 ] [ 21 ] [ 1 ] [ 22 ] [ 23 ] [ 4 ] [ 22 ] [ 3 ] [ 20 ] [ 1 ] [ 19 ] [ 8 ] |
private void button1_Click(object sender, System.EventArgs e) { Presentation pres = new Presentation(“Test.ppt”); MessageBox.Show("Nb Slides : " + pres.Slides.Count.ToString()); pres.Slides.RemoveAt(Int32.Parse(textBox1.Text)); pres.Write(“Test Result.ppt”); MessageBox.Show("Nb Slides : " + pres.Slides.Count.ToString()); } |
Thanks for Help because I really need to delete specific Slide.