Main Content


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

Get names of slide masters for presentation



mNames = getMasterNames(presentation) returns the names of slide masters for a presentation.


expand all

Get the slide master names so that you can find the layout names to use 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 a presentation.

ppt = Presentation("myPresentation");

Get the names of the master slides in the presentation. The default PPT API template has only one slide master.

mNames = getMasterNames(ppt);
ans = 
'Office Theme'

Get the names of the 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, using the Title Slide layout, 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 slide master names for, specified as an mlreportgen.ppt.Presentation object.

Output Arguments

expand all

Slide masters in the presentation, returned as a cell array of character vectors.

Version History

Introduced in R2015b