mlreportgen.ppt.ContentPlaceholder Class
Namespace: mlreportgen.ppt
Placeholder for slide content
Description
An object of the mlreportgen.ppt.ContentPlaceholder class represents a
content placeholder in a slide. You can replace a content placeholder with a picture,
table, or one or more paragraphs.
The PPT API creates a ContentPlaceholder object when you add a slide to
a presentation and the slide layout has a content placeholder. In the default PPT API,
these layouts have one or more content placeholders:
"Title and Content""Two Content""Comparison""Content with Caption"
To find a ContentPlaceholder object, use the find
method of the slide that contains the content placeholder. To replace the content
placeholder with a picture, table, or one or more paragraphs, use the
replace method of the ContentPlaceholder object. For
a picture or table, the replace method replaces the
ContentPlaceholder object with an mlreportgen.ppt.Picture or mlreportgen.ppt.Table object, respectively. For paragraphs, the PPT API
does not replace the ContentPlaceholder object. It adds mlreportgen.ppt.Paragraph objects as children of the
ContentPlaceholder object.
When you replace a ContentPlaceholder object with a
Table or Picture object, some of the
ContentPlaceholder object properties do not apply to the replacement
content. For details, see Properties.
Note
If you replace a content placeholder with a picture, Microsoft®
PowerPoint® adjusts the size of the content placeholder to accommodate the size of
the picture. If you want the placeholder position and size to be fixed in a slide,
use a slide with a picture placeholder. See mlreportgen.ppt.PicturePlaceholder.
The mlreportgen.ppt.ContentPlaceholder class is a handle class.
Class Attributes
HandleCompatible | true |
ConstructOnLoad | true |
For information on class attributes, see Class Attributes.
Properties
Methods
Examples
Tips
When you replace placeholder content in a presentation and then use the presentation as a template for a new presentation, the object that the PPT API creates for the content in the new presentation depends on the type of content, as shown in the table.
Replacement Content Class of Object in New Presentation picture mlreportgen.ppt.TemplatePicturetable mlreportgen.ppt.TemplateTableparagraph mlreportgen.ppt.ContentPlaceholderFor more information, see Add and Replace Presentation Content.
To see the placeholder objects that the PPT API creates for a slide object, view the
Childrenproperty of the slide. For example, when you add aTitle and Contentslide to a presentation, theChildrenproperty is an array that contains anmlreportgen.ppt.TextBoxPlaceholderobject and anmlreportgen.ppt.ContentPlaceholderobject.ppt = mlreportgen.ppt.Presentation("test.pptx"); open(ppt); slide = add(ppt,"Title and Content"); slide.Children(1)
ans = 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:6:11' Id: '6:11'slide.Children(2)
ans = ContentPlaceholder with properties: Bold: [] Font: [] ComplexScriptFont: [] FontColor: [] FontSize: [] Italic: [] Strike: [] Subscript: [] Superscript: [] Underline: [] BackgroundColor: [] VAlign: [] Name: 'Content' X: [] Y: [] Width: [] Height: [] Style: [] Children: [] Parent: [1×1 mlreportgen.ppt.Slide] Tag: 'ppt.ContentPlaceholder:7:12' Id: '7:12'
Version History
Introduced in R2015b
