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

Package: mlreportgen.ppt

Replace text box paragraphs

Syntax

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

Description

example

paraObj = replace(textBox,content) replaces paragraph in a text box.

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

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTextBoxReplacePresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Blank');

Create an mlreportgen.ppt.Paragraph object.

p = Paragraph('Hello World');

Add a text box to the blank slide (slide1).

tb = TextBox();
tb.X = '1in';
tb.Y = '1in';
tb.Width = '4 in';
tb.Height = '2in';

add(slide1,tb);

Add replace the text box with the paragraph.

add(tb,p);

Replace the content of the text box.

replace(tb,'This is the real content');

Generate the presentation.

close(slides);

Input Arguments

collapse all

Text box replace text in, specified as an mlreportgen.ppt.TextBox 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, returned as an mlreportgen.dom.Paragraph object.

Introduced in R2015b

Was this topic helpful?