Free Support Forum - aspose.com

Count and LastSlidePosition properties

Hello,

When I use the Slides collection I normally loop using the Count property, like this :

For iSlide As Integer = 1 To oPres.Slides().Count
Next

I always thought that Count and LastSlidePosition properties would have the same value.
However I just encountered a presentation where Count was 18 and LastSlidePosition was 17!
Looking at the presentation there are indeed 17 slides.

Should I use LastSlidePosition rather than Count? Would it be safer?
Can you give a word of explanation about what’s behind these two properties?
Why would they be different?

Best regards.

Hi Micheline M,

Thanks for your interest in Aspose.Slides.

Yes you are right that generally Count and LastSlidePostion properties return the same value. Can you please share the presentation, where by you are having problem. In PPTX we have only Count property and no LastSlidePosition property.

According to the case as mentioned by you, its safe to use LastSlidePosition property. But please share the presentation as well so that we can investigate the issue.

Thanks and Regards,

Hello,

Here is the sample PPT. We have removed most of the text content.
Please keep us informed. In the meantime we will add code to circumvent this.


Hi Micheline M,

I have worked on the presentation file that you have provided. Actually, your presentation also contain Title Master slide in it. There is no issue with Slides.Count or Slides.LastSlidePosition position property. Slides.Count contains all slides in collection along with Title master slide. Thats is why your slide count is 18 and last slide position is 17.

Thanks and Regards,