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
, orExternalLink
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);
Paragraph Object Formatting | Format Object | Format Property |
---|---|---|
Font family |
|
|
Font family for complex scripts to handle locales |
|
|
Font size |
|
|
Bold |
|
|
Font color |
|
|
Italic |
|
|
Strike |
|
|
Underline |
|
|
Subscript |
|
|
Superscript |
|
|
Horizontal alignment |
|
|
Level of indentation Use the PowerPoint® template to specify formatting for each level. | n/a |
|
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
mlreportgen.ppt.Text
|mlreportgen.ppt.Paragraph
|mlreportgen.ppt.ExternalLink
|mlreportgen.ppt.InternalLink
|mlreportgen.ppt.TextBox