Download MATLAB Report Generator User's Guide

Transcript
14
Programmatic PowerPoint Presentation Creation
Get Slide Layout Names
You need to know the name of slide layouts in a PowerPoint template to use the PPT API
to add a slide.
To see the names of slide layouts in a template using PowerPoint:
1
Select View > Slide Master.
2
In the left slide layout pane, hover over a slide layout under a slide master. A tooltip
appears with the name of the slide layout.
When you use the slide master name with the PPT API, omit the word Layout.
To see slide master names using the PPT API, use the
Presentation.getLayoutNames method. You need to get the slide master name
before you get the layout names. The PPT API returns slide masters as a cell array. This
example uses the default PPT API PowerPoint template.
import mlreportgen.ppt.*;
slides = Presentation('myPresentation');
masters = getMasterNames(slides);
layouts = getLayoutNames(slides,masters{1});
layouts
Columns 1 through 5
'Title Slide' 'Title and Vertica…'
14-40
'Vertical Title an…'
'Title and Table'
'Title