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

Package: mlreportgen.ppt

Add paragraphs to text box placeholder

Syntax

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

Description

example

paraObj = add(textBoxPlaceholder,content) adds text in a text box placeholder.

add(textBoxPlaceholder,contents) adds multiple paragraphs to a text box placeholder.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTextBoxPlaceholderAddPresentation.pptx';
slides = Presentation(slidesFile);
add(slides,'Title and Content');

Create an mlreportgen.ppt.Paragraph object.

p = Paragraph('Hello World');

Use the Presentation.find method to find content the text box placeholder called Title in the presentation. Replace the title for the first slide with the paragraph.

contents = find(slides,'Title');

Add the paragraph to the first slide.

replace(contents(1),p);

Add the paragraph to the first slide.

add(contents(1),' -- How are You?');

Generate the presentation.

close(slides);

Input Arguments

collapse all

Text box placeholder to add text to, specified as an mlreportgen.ppt.TextBoxPlaceholder object.

Content to add to a text box placeholder, specified as a character vector, array, cell array, or Paragraph object. If you specify an array, include only mlreportgen.ppt.Paragraph objects in the array. If you specify a cell array, you can include character vectors and mlreportgen.ppt.Paragraph objects.

Text 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, returned as an mlreportgen.dom.Paragraaph object.

Introduced in R2015b

Was this topic helpful?