Free Support Forum -

Slide Questions

Couple of questions:

1. How can I check to see if a slide exists? ie. before cloning, verify that the slide to be cloned actually exists.

2. What is the difference between slides[x] and getSlideByPosition(x)? They don’t seem to return the same slide.



Hello Bijoy,
1. All slides in presentation exist, at least I hope so. There are master slides, which are invisible in PowerPoint (do not confuse them with hidden slides) and used by other slides. The simpliest way to check, if slide is not master - to check its SlidePosition property. For all nonmaster slides its value greater than 0.
2. Slides property is a collection of all slides except MainMaster, its order is nothing to do with order of slides in PowerPoint. GetSlideByPosition returns slides in “user’s” order, as they listed in PowerPoint. GetSlideByPosition is 1-based (first slide’s position is 1). For all x greater than actual number of nonmaster slides null will be returned.