Main Content

getLayoutNames

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

Get names of layouts for presentation slide master

Description

example

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

Examples

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

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

masters = getMasterNames(ppt);

Get the names of 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 presentation 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 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.

Introduced in R2015b