Main Content

add

Class: mlreportgen.ppt.TextBox
Package: mlreportgen.ppt

Add paragraph to text box

Description

example

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

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

Examples

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(slide,tb);

Add text to the text box.

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

Close and view the presentation.

close(ppt);
rptview(ppt);

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.

Introduced in R2015b