Main Content

Create and Format Paragraphs

Create a Paragraph

To create aParagraphobject, use themlreportgen.ppt.Paragraphconstructor. You can:

  • Create an emptyParagraphobject.

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

  • Specify aText,InternalLink, orExternalLinkobject as the paragraph text.

After you create aParagraphobject, you can append character vectors, string scalars, orText,InternalLink, orExternalLinkobjects 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 toText,InternalLink, andExternalLinkobjects 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 =“红色”; append(p,redText); moreText = Text(' back to default green text'); append(p,moreText);

Generated text consists of a green bullet and the text

ParagraphObject Formatting Format Object Format Property

字体

FontFamily

Font

字体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 aParagraphobject is a subscript or superscript, usingTextobjects withSubscriptorSuperscript属性设置为you greater formatting flexibility.

See Also

Classes

Classes

Related Examples

More About