Main Content

mlreportgen.ppt.TextBox Class

Namespace: mlreportgen.ppt

Description

Text box to include in a presentation.

The mlreportgen.ppt.TextBox class is a handle class.

Creation

Description

textBoxObj = TextBox creates an empty text box object.

example

Properties

expand all

Text box name, specified as a character vector or string scalar.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Font family for the text, specified as a character vector or string scalar. Specify a font that appears in the font list in Microsoft® PowerPoint®. To see the font list, in PowerPoint, on the Home tab, in the Font group, click the arrow to the right of the font.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Font family for complex scripts, specified as a character vector or string scalar. Specify a font family to use when substituting in a locale that requires a complex script, such as Arabic or Asian, to render text.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Font color for the text, specified as a character vector or string scalar that contains a CSS color name or hexadecimal RGB value.

  • To use the name of a color, specify a CSS color name. For a list of CSS color names, seehttps://www.w3.org/wiki/CSS/Properties/color/keywords.

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

Example: "blue"

Example: "#0000ff"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Font size of the text, specified as a character vector or string scalar that contains a number followed by a unit of measurement. For example, "11pt" specifies 11 points. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Option to use bold for text, specified as a numeric or logical 1 (true) or 0 (false). To make text bold, set this property to true or 1.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Whether to use italic for the text, specified as a numeric or logical 1 (true) or 0 (false). If Italic is true or 1, text renders in italic. If Italic is false or 0, text renders as straight.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Strikethrough style for the text, specified as one of these values:

  • "single" — Single horizontal line

  • "none" —No strikethrough line

  • "double" — Double horizontal line

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Whether to display the text as a subscript, specified as a numeric or logical 1 (true) or 0 (false). If Subscript is true or 1, text renders as a subscript. If Subscript is false or 0, text renders as regular text.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Whether to display the text as a superscript, specified as a numeric or logical 1 (true) or 0 (false). If Superscript is true or 1, text renders as a superscript. If Superscript is false or 0, text renders as regular text.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Underline style for the text, specified as one of these values:

ValueDescription
"single"Single underline
"double"Double underline
"heavy"Thick underline
"words"Only words 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
"dotdashheavy"Thick, dot-dash underline
"dotdotdash"Dot-dot-dash underline
"dotdotdashheavy"Thick, dot-dot-dash underline
"wavy"Wavy underline
"wavyheavy"Thick, wavy underline
"wavydouble"Wavy, double underline
"none"No underline

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Background color that contains a CSS color name or a hexadecimal RGB value, specified as a character vector or string scalar.

  • To use the name of a color, specify a CSS color name. For a list of CSS color names, seehttps://www.w3.org/wiki/CSS/Properties/color/keywords.

  • To specify a hexadecimal RGB format, use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values.

Note

Setting the BackgroundColor property adds a mlreportgen.ppt.BackgroundColor format object to the Style property. Setting the BackgroundColor property to an empty value removes the object.

Example: "blue"

Example: "#0000ff"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Vertical alignment of the text, specified as one of these values:

ValueDescription

"top"

Vertically aligned to the top

"bottom"

Vertically aligned to the bottom of the table entry

"middle"

Vertically aligned to the middle of the table entry

"topCentered"

Vertically aligned to the top and horizontally aligned to the center of the table entry

"bottomCentered"

Vertically aligned to the bottom and horizontally aligned to the center of the table entry

"middleCentered"

Vertically aligned to the middle and horizontally aligned to the center of the table entry

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Upper-left x-coordinate position, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "5in" specifies five inches. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Note

When the PPT API creates an mlreportgen.ppt.TextBox object, this property value is specified in English Metric Units (EMU). If you set this property, you must use one of the units in the previous list.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Upper-left y-coordinate position, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "5in" specifies five inches. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Note

When the PPT API creates an mlreportgen.ppt.TextBox object, this property value is specified in English Metric Units (EMU). If you set this property, you must use one of the units in the previous list.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Width of text box, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Height of text box, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

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

  • BackgroundColor object

  • FontFamily object

  • FontSize object

  • Bold object

  • FontColor object

  • Italic object

  • Underline object

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: cell

Child elements of this object, specified as a cell array of PPT API objects.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

Data Types: cell

Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

Tag, specified as a character vector or string scalar. The PPT API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The PPT API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Methods

expand all

Examples

collapse all

Create a presentation with two slides.

import mlreportgen.ppt.*
ppt = Presentation("myTextBoxPresentation.pptx");

Add a blank slide.

blank = add(ppt,"Blank");

Create a text box and define its location and size.

tb = TextBox();
tb.X = "1in";
tb.Y = "1in";
tb.Width = "8in";
tb.Height = "0.5in";

Add text to the text box and append the text box to the blank slide.

add(tb,"This is the title of my blank slide");
add(blank,tb);

Close and view the presentation.

close(ppt);
rptview(ppt);

Here is the generated presentation:

Generated presentation slide that reads "This is the title of my blank slide"

Version History

Introduced in R2014b