Main Content

Create and Format Paragraphs

Create a Paragraph

To create a Paragraph object, use the mlreportgen.ppt.Paragraph constructor. You can:

  • Create an empty Paragraph object.

  • Specify a character vector or string scalar for the paragraph text.

  • Specify a Text, InternalLink, or ExternalLink object as the paragraph text.

After you create a Paragraph object, you can append character vectors, string scalars, or Text, InternalLink, or ExternalLink objects to add text to the paragraph. You can specify separate formatting for each object that you append.

Format Paragraph Content

You can specify the default formatting to apply to the text in a paragraph. The paragraph formatting applies to text that you add. The paragraph formatting applies to Text, InternalLink, and ExternalLink objects in the paragraph, unless those objects specify formatting that overrides the default paragraph formatting. For example, this code produces alternating red and green text:

p = Paragraph('Default paragraph green text');
p.FontColor = 'green';

redText = Text('  red text');
redText.FontColor = 'red';
append(p,redText);

moreText = Text('  back to default green text');
append(p,moreText);

Generated text consists of a green bullet and the text "Default paragraph green text" in green, the text "red text" in red, and the text "back to default green text" in green.

Paragraph Object Formatting Format ObjectFormat Property

Font family

FontFamily

Font

Font family for complex scripts to handle locales

FontFamily

ComplexScriptFont

Font size

FontSize

FontSize

Bold

Bold

Bold

Font color

FontColor

FontColor

Italic

Italic

Italic

Strike

Strike

Strike

Underline

Underline

Underline

Subscript

Subscript

Subscript

Superscript

Superscript

Superscript

Horizontal alignment

HAlign

HAlign

Level of indentation

Use the PowerPoint® template to specify formatting for each level.

n/a

Level

Tip

Although you can specify that text in a Paragraph object is a subscript or superscript, using Text objects with Subscript or Superscript property set gives you greater formatting flexibility.

See Also

Classes

Classes

Related Examples

More About