Main Content


Class: mlreportgen.ppt.Presentation
Namespace: mlreportgen.ppt

Get names of layouts for presentation slide master



layoutNames = getLayoutNames(presentation,slideMaster) returns the names of layouts for a presentation slide master.


expand all

Get the names of the slide layouts in the master slide of the default PPT API template. Use the layout names when you add slides to a presentation.

Import the PPT namespace so that you do not have to use long, fully qualified names for the PPT API classes.

import mlreportgen.ppt.*

Create and open a presentation.

ppt = Presentation("myPresentation.pptx");

Get the names of the slide masters in the presentation. The default template has only one slide master.

mNames = getMasterNames(ppt);

Get the names of layouts in the slide master.

layouts = getLayoutNames(ppt,mNames{1})
layouts = 1×13 cell
    {'Title Slide'}    {'Title and Vertical Text'}    {'Vertical Title and Text'}    {'Title and Table'}    {'Title and Picture'}    {'Title and Content'}    {'Section Header'}    {'Two Content'}    {'Comparison'}    {'Title Only'}    {'Blank'}    {'Content with Caption'}    {'Picture with Caption'}

Add a title slide to the presentation and replace the title in the slide.

slide = add(ppt,"Title Slide");
replace(slide,"Title","My Title");

Close and view the presentation.


Input Arguments

expand all

Presentation to get layout names for, specified as an mlreportgen.ppt.Presentation object.

Slide master to get layout names for, specified as a character vector or string scalar.

Output Arguments

expand all

Slide layout names, returned as a cell array of character vectors.

Version History

Introduced in R2015b