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.ContentPlaceholder.add

Package: mlreportgen.ppt

Add paragraph or paragraphs to content placeholder

Syntax

paraObj = add(contentPlaceholder,content)
add(contentPlaceholder,contents)

Description

example

paraObj = add(contentPlaceholder,content) adds a paragraph to a content placeholder.

add(contentPlaceholder,contents) adds multiple paragraphs to a content placeholder.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*
slidesFile = 'myContentPlaceholder.pptx';
slides = Presentation(slidesFile);
add(slides,'Title and Content');

Use the Presentation.find method to find the Content placeholders.

contents = find(slides,'Content');

Create an mlreportgen.ppt.Paragraph object. Add the paragraph to the first Content placeholder.

para = add(contents(1),'First item in the list' );
para.Italic = true;
para.FontColor = 'green';

Add multiple paragraphs to the first Content placeholder.

add(contents(1),{ ...
    'List item', ...
        {'Inner list item','Other inner list item' }...
    'List item', ...
    });

Generate the presentation and then open myBoldPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

close(slides);
 
if ispc
    winopen(slidesFile);
end

Input Arguments

collapse all

Content placeholder to add content to, specified as an mlreportgen.ppt.ContentPlaceholder object.

Content to add, specified as a character vector or an mlreportgen.ppt.Paragraph object. The slide layout specifies whether the text displays as a paragraph, bulleted list item, or numbered list item.

Content to add, specified as a cell array of character vectors, mlreportgen.ppt.Paragraph objects, or a combination of both. Inner cell arrays specify inner list items. The slide layout specifies whether the text displays as paragraphs, bulleted list items, or numbered list items.

Output Arguments

collapse all

Paragraph added to content placeholder, returned as an mlreportgen.ppt.Paragraph object.

Introduced in R2015b

Was this topic helpful?