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.replace

Package: mlreportgen.ppt

Replace text box placeholder paragraphs

Syntax

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

Description

example

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

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

Examples

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.

replace(contents(1),p);

Close the presentation.

close(slides);

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

Was this topic helpful?