Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.ppt.TextBoxPlaceholder class

Package: mlreportgen.ppt
Superclasses:

Slide placeholder to replace with text box

Description

Slide placeholder to replace with a text box. You can create a text box placeholder using a layout slide. In the default PPT API, when you add a Title Slide slide to a presentation, the API creates a TextBoxPlaceholder object. Use the find method with the slide object, to find the text box placeholder. You can then set properties for that TextBoxPlaceholder object.

To use the PowerPoint® editor to insert a picture placeholder in a presentation:

  1. Select the Slide Master tab.

  2. Click the layout slide you want to add the picture placeholder to. You can add the placeholder to an existing or a new layout slide.

  3. In the toolbar, click Insert Placeholder and select Text.

Properties

expand all

Option to use bold for text, specified as a logical. To make text bold, set this property to true or 1. Setting the Bold property adds a corresponding mlreportgen.ppt.Bold format object to the Style property of this presentation element. Removing the Bold property setting removes the object.

Data Types: logical

Font color, specified as a character vector. Use either a CSS color name or a hexadecimal RGB value.

  • For a list of CSS color names, see http://www.crockford.com/wrrrld/color.html.

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

Option to use italics for text, specified as a logical. Set this property to true. Setting the Italic property adds a corresponding mlreportgen.ppt.Italic format object to the Style property of this presentation element. Removing the Italic property setting removes the object.

Data Types: logical

Type of underlining for text, specified as a character vector. Setting the Underline property adds a corresponding mlreportgen.ppt.Underline format object to the Style property for this element. Removing the Underline property setting removes the object. You can specify one of these types of underlines.

ValueDescription
'single'Single underline
'double'Double underline
'heavy'Thick underline
'words'Words only 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
'dotdotdash'Dot dot dash underline
'dotdotdashheavy'Thick dot dot dash underline
'dotdashdotheavy'Thick dash dot underline
'wavy'Wavy underline
'wavyheavy'Thick wavy underline
'wavydouble'Two wavy underlines

Text box placeholder name, specified as a character vector.

Upper-left x-coordinate position of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Upper-left y-coordinate position of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Width of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Height of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Text formatting, specified as an array of PPT style objects. You can specify these mlreportgen.ppt style objects:

  • BackgroundColor object

  • FontFamily object

  • FontSize object

  • FontColor object

  • Italic object

  • Underline object

This read-only property lists child elements that the object contains, specified as a cell array.

This read-only property lists the parent of this object, specified a PPT object.

ID for PPT API object, specified as a character vector. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

Tag for this PPT API object, specified as a character vector. 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.

An example of a reason for specifying your own tag value is to make it easier to identify where an issue occurred during presentation generation.

Methods

Method

Purpose

add

Add content to placeholder.

replace

Replace placeholder content.

Examples

expand all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTextBoxPlaceholderPresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title Slide');

Create a paragraph.

p = Paragraph('My Presentation Title');

The Title Slide layout includes a text box object named Title. Use the mlreportgen.ppt.Slide.find method to find an object with the Name property of Title.

contents = find(slide1,'Title')
contents = 

  TextBoxPlaceholder with properties:

           Bold: []
      FontColor: []
         Italic: []
         Strike: []
      Subscript: []
    Superscript: []
      Underline: []
           Name: 'Title'
              X: []
              Y: []
          Width: []
         Height: []
          Style: []
       Children: []
         Parent: [1x1 mlreportgen.ppt.Slide]
            Tag: 'ppt.TextBoxPlaceholder:5417:755'
             Id: '5417:755'

Replace the placeholder with the paragraph.

replace(contents(1),p);

Close the presentation.

close(slides);

Open myTextBoxPlaceholderPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc
    winopen(slidesFile);
end

Introduced in R2015b

Was this topic helpful?