Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.ppt.Presentation.add

Package: mlreportgen.ppt

Add slide to presentation

Syntax

slideObj = add(presentation,slideLayout)
slideObj = add(presentation,slideLayout,slideMaster)
slideObj = add(presentation,slideLayout,otherSlide)
slideObj = add(presentation,slideLayout,slideMaster,otherSlide)
slideObj = add(presentation,slideLayout,index)
slideObj = add(presentation,slideLayout,slideMaster,index)

Description

example

slideObj = add(presentation,slideLayout) adds a slide to the presentation, using the specified slide layout under the first slide master in the presentation.

example

slideObj = add(presentation,slideLayout,slideMaster) uses the slide layout under the specified slide master. Use the slideMaster argument when the presentation contains multiple slide masters. If you do not provide the slideMaster argument, a new slide is created from the first layout that matches with slideLayout name.

example

slideObj = add(presentation,slideLayout,otherSlide) adds the slide immediately before the slide specified in the otherSlide argument, using the specified slide layout under the first slide master in the presentation.

slideObj = add(presentation,slideLayout,slideMaster,otherSlide) adds the slide immediately before the otherSlide slide, using the specified slide layout under the specified slide master.

example

slideObj = add(presentation,slideLayout,index) adds the slide at the index position specified by index, using the specified slide layout under the specified slide master.

slideObj = add(presentation,slideLayout,slideMaster,index) adds the slide immediately before the slide specified by otherSlide, using the specified slide layout under the specified slide master.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*
slidesFile = 'myAddSlidesPresentation.pptx';
slides = Presentation(slidesFile);

Add a first slide, specifying the slide layout, but not the slide master or location.

contentSlide = add(slides,'Title and Content');
replace(contentSlide,'Title','This is the Title of the Slide Content');

Add another slide using the Office Theme slide master. Have it appear before contentSlide.

titleSlide = add(slides,'Title Slide','Office Theme',contentSlide);
replace(titleSlide,'Title','Presentation Title');

Add a blank slide using the Office Theme slide master. Make the new slide the second slide in the presentation.

blankSlide = add(slides,'Blank','Office Theme',2);

Close presentation.

close(slides);

Open myAddSlidesPresentation.pptx file. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc
    winopen(slidesFile);
end

Input Arguments

collapse all

Presentation to add content to, specified as an mlreportgen.ppt.Presentation object.

Layout of slide to add, specified as a character vector. The layout must be in the presentation template.

To see the available layouts, you can:

  • Use the mlreportgen.ppt.Presentation.getLayoutNames method.

  • In the PowerPoint® template, select Home > Layout.

Slide master for the specified slide layout. The slide master must be in the presentation template.

To see the available layouts, use one of these approaches:

  • Use the mlreportgen.ppt.Presentation.getSlideMasterNames method.

  • In the PowerPoint template, select View > Slide Master. The slide masters are the numbered slides. To get the name of a slide master, hover over it. Specify the name without including the words Slide Master.

Slide to insert new slide before, specified as an mlreportgen.ppt.Slide object.

Index representing position of slide in presentation, specified as a double.

Output Arguments

collapse all

Slide, returned as an mlreportgen.ppt.Slide object.

Introduced in R2015b

Was this topic helpful?