Main Content

getMasterNames

Class: mlreportgen.ppt.Presentation
Package: mlreportgen.ppt

Get names of slide masters for presentation

Description

example

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

Examples

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 package 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');
open(ppt);

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

masters = getMasterNames(ppt);
masters{1}
ans = 
'Office Theme'

Get the names of the layouts in the slide master.

layouts = getLayoutNames(ppt,masters{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 presentaton, 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.

close(ppt);
rptview(ppt);

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.

Introduced in R2015b