This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Package: mlreportgen.ppt

Replace text box placeholder paragraphs


paraObj = replace(textBoxPlaceholder,content)



paraObj = replace(textBoxPlaceholder,content) replaces the text in a text box placeholder.

replace(textBoxPlaceholder,contents) replaces multiple paragraphs in a text box placeholder.


collapse all

Create a presentation.

import mlreportgen.ppt.*

slides = Presentation('myTextBoxReplacePresentation');
add(slides,'Title and Content');

Create an mlreportgen.ppt.Paragraph object.

p = Paragraph('Hello World');

Use the Presentation.find method to find text box placeholders 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.


Close the presentation.


Input Arguments

collapse all

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

Text to use as replacement, 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.

Content to use as a replacement, 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, represented by an mlreportgen.ppt.Paragraph object.

Introduced in R2015b