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

Add paragraph to text box


paraObj = add(textBox,content)



paraObj = add(textBox,content) adds a paragraph to a text box.

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


collapse all

Create a presentation.

import mlreportgen.ppt.*

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

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 text to the text box.

para = add(tb,'This is the content');
para.Bold = true;

Generate the presentation.


Input Arguments

collapse all

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

Content to add to a text box, 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 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.Paragraph object.

Introduced in R2015b