office-jsjavascript-api-for-office

How to get the layout count present in slide master with office js


I want to access layout count which are present in slide master.

const slideMaster = context.presentation.slideMasters.getItem(0).layouts;

Solution

  • The PowerPoint.SlideMasterCollection class offers the items property which you can use the count the number of layouts in the SlideMasterCollection. The Add slides to a presentation snippet shows some strategies for working with layouts.