mlreportgen.ppt.Slide class
Package: mlreportgen.ppt
Presentation slide
Description
An object of the mlreportgen.ppt.Slide
class represents a slide in a
Microsoft®
PowerPoint® presentation. To create a Slide
object and add it to a
presentation, use the add
method of an mlreportgen.ppt.Presentation
object. The add
method
returns the Slide
object. You can use the Slide
object
methods to add, find, and replace slide content.
The mlreportgen.ppt.Slide
class is a handle
class.
Class Attributes
Abstract | true |
ConstructOnLoad | true |
HandleCompatible | true |
For information on class attributes, see Class Attributes.
Properties
Layout
— Slide layout name
character vector
Slide layout name, specified as a character vector. This property is read-only.
SlideMaster
— Slide master name
character vector
Slide master name, specified as a character vector. This property is read-only.
Name
— Slide name
''
(default) | character vector | string scalar
Slide name, specified as a character vector or string scalar. You can set
the Name
property to identify a slide in a
presentation. See the find
method of the
mlreportgen.ppt.Presentation
class.
Style
— Slide formatting
[]
| cell array of PPT format objects
Slide formatting, specified as a cell array of PPT format objects.
Add format objects by concatenating the existing value of the
Style
property with a cell array that contains the
format objects that you are adding. For
example:
import mlreportgen.ppt.* ppt = Presentation('MyPresentation'); open(ppt); slide = add(ppt,'Title Only'); slide.Style = [slide.Style {Bold(true),FontColor('red')}]; replace(slide,'Title','My Title is Bold and Red'); close(ppt); rptview(ppt);
Children
— Children of this slide
cell array of PPT objects
Child elements of this slide, specified as a cell array of PPT objects. This property is read-only.
Parent
— Parent of this slide object
PPT object
Parent of this slide, specified as a PPT object. This property is read-only.
Id
— ID for this PPT API object
character vector | string scalar
ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.
Tag
— Tag for this PPT API object
character vector | string scalar
Tag for this PPT API object, specified as a character vector or string scalar. A
session-unique tag is generated as part of the creation of this object. The generated
tag has the form CLASS:ID
, where CLASS
is the
object class and ID
is the value of the Id
property of the object.
Specifying your own tag value can help you to identify where an issue occurred during presentation generation.
Methods
Examples
Add a Slide to a Presentation
To add a slide to a presentation, use the add
method of the mlreportgen.ppt.Presentation
object. The add
method returns an mlreportgen.ppt.Slide
object. Use the replace
method of the Slide
object to replace content placeholders with your content.
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);
Add a slide that has a Title and Table
layout.
slide = add(ppt,"Title and Table");
Replace the Title
placeholder in the slide with the title text.
replace(slide,"Title","magic(4)");
Replace the Table
placeholder in the slide with a table.
tbl = Table(magic(4));
replace(slide,"Table",tbl);
Close and view the presentation.
close(ppt); rptview(ppt);
Here is the generated presentation:
Version History
Introduced in R2015a
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)