add

Class: mlreportgen.ppt.TextBoxPlaceholder
Package: mlreportgen.ppt

Add paragraphs to text box placeholder

Description

example

paraObj = add(textBoxPlaceholder,content) adds text in a text box placeholder.

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

Examples

expand all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTextBoxPlaceholderAddPresentation.pptx';
slides = Presentation(slidesFile);
add(slides,'Title and Content');

Create an mlreportgen.ppt.Paragraph object.

p = Paragraph('Hello World');

Use the Presentation.find method to find content the text box placeholder 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);

Add the paragraph to the first slide.

add(contents(1),' -- How are You?');

Generate the presentation.

close(slides);

Input Arguments

expand all

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

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

Text 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

expand all

Paragraph, returned as an mlreportgen.dom.Paragraaph object.

Introduced in R2015b