mlreportgen.ppt.Slide Class
Namespace: 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 or string scalar. This property is read-only.
SlideMaster
— Slide master name
character vector
Slide master name, specified as a character vector or string scalar. This property is read-only.
Name
— Slide name
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.
Attributes:
NonCopyable | true |
Data Types: char
| string
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 mlreportgen.ppt.Slide
object
PPT API object
Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.
Attributes:
SetAccess | private |
NonCopyable | true |
Id
— Object identifier for mlreportgen.ppt.Slide
object
character vector | string scalar
Object identifier for the mlreportgen.ppt.Slide
object, specified as a
character vector or string scalar. The PPT API generates a session-unique identifier
when it creates the document element object. You can specify your own value for
Id
.
Attributes:
NonCopyable | true |
Data Types: char
| string
Tag
— Tag for mlreportgen.ppt.Slide
object
character vector | string scalar
Tag for the mlreportgen.ppt.Slide
object, specified as a character vector or
string scalar. The PPT API generates a session-unique tag 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. Specify your own tag value to help
you identify where to look when an issue occurs during document generation.
Attributes:
NonCopyable | true |
Data Types: char
| string
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 namespace 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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)