Main Content


Class: mlreportgen.ppt.TextBox
Namespace: mlreportgen.ppt

Add paragraph to text box



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

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


expand all

Create a presentation with one slide.

import mlreportgen.ppt.*
ppt = Presentation('myTextBoxAddPresentation.pptx');
slide = add(ppt,'Blank');

Add a text box to the blank slide.

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;

Close and view the presentation.


Input Arguments

expand 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, string scalar, or mlreportgen.ppt.Paragraph object.

Multiple paragraphs to add, specified as a string array or as a cell array that can contain character vectors, mlreportgen.ppt.Paragraph objects, or combination of character vectors, strings scalars, string arrays, or mlreportgen.ppt.Paragraph objects. For a cell array, contents of inner cell arrays or string arrays are indented from the contents of the outer cell array.

Output Arguments

expand all

Paragraph, returned as an mlreportgen.ppt.Paragraph object.

Version History

Introduced in R2015b