Create and Format Text
Create Text
You can create a Text
object using an mlreportgen.ppt.Text
constructor, specifying a character vector.
Also, you can create text by using a character vector or string scalar with objects of these PPT API classes:
Paragraph
InternalLink
ExternalLink
TableEntry
TextBox
ContentPlaceholder
TextBoxPlaceholder
For example:
import mlreportgen.ppt.*; ppt = Presentation('myPresentation.pptx'); slide1 = add(ppt,'Title Slide'); contents = find(slide1,'Title'); titleText = replace(contents(1),'My Title');
For more information about creating and adding text, see Add and Replace Text.
Create a Subscript or Superscript
You can enable the Subscript
or Superscript
property for a Text
object. Enabling these properties specifies that the text gets treated as a subscript or superscript when you add it to a Paragraph
object. For example, you can set up a paragraph to display x2
.
super = Text('2'); super.Superscript = true; para = Paragraph('x'); append(para,super);
Format Text
To format a Text
object, use format objects with a Text
object Style
property or use Text
object properties. For example:
t = Text('green text'); t.Style = {Bold(true)}; t.FontColor = 'green';
Text Object Formatting | Format Object | Format Property |
---|---|---|
Font family |
|
|
Font family for complex scripts to handle locales |
|
|
Font size |
|
|
Font color |
|
|
Bold |
|
|
Italic |
|
|
Strike |
|
|
Underline |
|
|
Subscript |
|
|
Superscript |
|
|
See Also
Classes
mlreportgen.ppt.Text
|mlreportgen.ppt.Paragraph
|mlreportgen.ppt.InternalLink
|mlreportgen.ppt.ExternalLink
|mlreportgen.ppt.TextBox