We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

getSlideByPosition in pptx


I am currently using the following code for .ppt. Now I want to change ny code to .pptx. But getSlideByPosition method is missing for pptx. What is the alternative for this . (I am using Aspose slides 7.4)
Presentation ppt = new Presentation();
Slide slide = ppt.getSlideByPosition(1);

Please suggest me.

Hi Priyank,

The getSlideByPosition() method is actually applicable in case of PPT where by SlideCollection has both normal and slide master slides inside that. In case of PPTX, we have separate collection for normal and master slides. So, there is no need of method getSlideByPosition() there. You can use the normal slide access method and index specifies the position.

In order to access the first slide, you can use:

SlideEx slides=pres.getSlides().get_Item(0);

So, for nth slide, you need to access that on index n-1. I hope this will work for you. Please share, if I may help you further in this regard.

Many Thanks,

Thank you