Add a Title and Picture
slide to a presentation and then replace the title and picture placeholders with your own title and picture.
Import the PPT namespace so that you do not have to use long, fully qualified names for the PPT API classes.
Create a presentation.
Add a slide that has a Title and Picture
layout.
Use the find
method of the slide object to find the placeholder object that has the name Title
.
titlePlaceholderObj =
TextBoxPlaceholder with properties:
Bold: []
Font: []
ComplexScriptFont: []
FontColor: []
FontSize: []
Italic: []
Strike: []
Subscript: []
Superscript: []
Underline: []
BackgroundColor: []
VAlign: []
Name: 'Title'
X: []
Y: []
Width: []
Height: []
Style: []
Children: []
Parent: [1×1 mlreportgen.ppt.Slide]
Tag: 'ppt.TextBoxPlaceholder:30:125'
Id: '30:125'
The find
method returns an mlreportgen.ppt.TextBoxPlaceholder
object.
Replace the placeholder content with the title text.
Use the find
method of the slide object to find the placeholder object that has the name Picture
.
picturePlaceholderObj =
PicturePlaceholder with properties:
Bold: []
Font: []
ComplexScriptFont: []
FontColor: []
FontSize: []
Italic: []
Strike: []
Subscript: []
Superscript: []
Underline: []
BackgroundColor: []
VAlign: []
Name: 'Picture'
X: []
Y: []
Width: []
Height: []
Style: []
Children: []
Parent: [1×1 mlreportgen.ppt.Slide]
Tag: 'ppt.PicturePlaceholder:31:126'
Id: '31:126'
The find
method returns an mlreportgen.ppt.PicturePlaceholder
object.
Replace the picture placeholder with a picture.
Close and view the presentation.
PowerPoint® adjusts the picture dimensions to fit in the picture placeholder. If the picture placeholder dimensions are bigger than the Picture
object dimensions, the picture stretches proportionally. If the dimensions are smaller, the picture is centered.