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.Paragraph class

Package: mlreportgen.ppt
Superclasses:

Formatted block of text (paragraph)

Description

To define a paragraph, use an mlreportgen.ppt.Paragraph object. A paragraph can contain text, mlreportgen.ppt.Text objects, or mlreportgen.ppt.ExternalLink objects.

Construction

paragraphObj = Paragraph() creates an empty paragraph object.

paragraphObj = Paragraph(text) creates a paragraph containing a mlreportgen.ppt.Text object with the text specified by text.

paragraphObj = Paragraph(pptElementObj) creates a paragraph containing the text or external link specified by pptElementObj.

Input Arguments

expand all

Paragraph text, specified as a character vector.

Presentation element to include in paragraph, specified as either an mlreportgen.ppt.Text or mlreportgen.ppt.ExternalLink object.

Output Arguments

expand all

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

Properties

expand all

Option to use bold for text, specified as a logical. To make text bold, set this property to true or 1. Setting the Bold property adds a corresponding mlreportgen.ppt.Bold format object to the Style property of this presentation element. Removing the Bold property setting removes the object.

Data Types: logical

Font color, specified as a character vector. Use either a CSS color name or a hexadecimal RGB value.

  • For a list of CSS color names, see http://www.crockford.com/wrrrld/color.html.

  • To specify a hexadecimal RGB format, use # as the first character and two-digit hexadecimal numbers for each for the red, green, and blue values. For example, '#0000ff' specifies blue.

Option to use italics for text, specified as a logical. Set this property to true. Setting the Italic property adds a corresponding mlreportgen.ppt.Italic format object to the Style property of this presentation element. Removing the Italic property setting removes the object.

Data Types: logical

Type of underlining for text, specified as a character vector. Setting the Underline property adds a corresponding mlreportgen.ppt.Underline format object to the Style property for this element. Removing the Underline property setting removes the object. You can specify one of these types of underlines.

ValueDescription
'single'Single underline
'double'Double underline
'heavy'Thick underline
'words'Words only underlined (not spaces)
'dotted'Dotted underline
'dottedheavy'Thick, dotted underline
'dash'Dashed underline
'dashheavy'Thick, dashed underline
'dashlong'Long, dashed underline
'dashlongheavy'Thick, long, dashed underline
'dotdash'Dot dash underline
'dotdotdash'Dot dot dash underline
'dotdotdashheavy'Thick dot dot dash underline
'dotdashdotheavy'Thick dash dot underline
'wavy'Wavy underline
'wavyheavy'Thick wavy underline
'wavydouble'Two wavy underlines

Indentation level of a paragraph, specified as one of these values:

  • 1 — Top-level paragraph (no indentation)

  • 2 — Second-level paragraph

  • 3 — Third-level paragraph

  • 4 — Fourth-level paragraph

Text formatting, specified as a cell array of PPT style objects. You can specify these mlreportgen.ppt style objects:

  • FontFamily object

  • FontSize object

  • Bold object

  • FontColor object

  • Italic object

  • Underline object

This read-only property lists child elements that the object contains, specified as a cell array.

This read-only property lists the parent of this object, specified a PPT object.

ID for PPT API object, specified as a character vector. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

Methods

Method

Purpose

append

Append text or external link to paragraph.

Examples

expand all

Create a presentation with two slides.

import mlreportgen.ppt.*;

slidesFile = 'myParagraphPresentation.pptx';
slides = Presentation(slidesFile);

add(slides,'Title Slide');
add(slides,'Title and Content');

Create a Paragraph object to use for the title of slides. Make the text bold and red.

p = Paragraph('My Title');
p.Bold = true;
p.FontColor = 'red';

Replace the title for the first slide with the paragraph.

contents = find(slides,'Title');
replace(contents(1),p);

Create a paragraph for the content of the second slide.

p1 = Paragraph('My slide content');
append(p1,' for the second slide');

Replace the content with the p1 paragraph.

replace(slides,'Content',p1);

Close the presentation.

close(slides);

Open myParagraphPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc
    winopen(slidesFile);
end

Was this topic helpful?