mlreportgen.ppt.InternalLink Class
Namespace: mlreportgen.ppt
Superclasses: mlreportgen.ppt.Text
Description
Use an object of the mlreportgen.ppt.InternalLink
class to link from one slide to another
slide in a presentation.
The mlreportgen.ppt.InternalLink
class is a handle
class.
Class Attributes
ConstructOnLoad | true |
HandleCompatible | true |
For information on class attributes, see Class Attributes.
Creation
Properties
Target
— Target slide for hyperlink
[]
(default) | integer | character vector | string scalar
Target slide of the hyperlink, specified as an integer, character vector, or string scalar. Use an integer to indicate the index of the target slide. Use a character vector or string scalar to indicate the name of the target slide.
Attributes:
NonCopyable | true |
Data Types: char
| string
Content
— Link text
''
(default) | character vector | string scalar
Link text, specified as a character vector or string scalar.
Attributes:
NonCopyable | true |
Data Types: char
| string
Bold
— Whether to use bold for link text
[]
(default) | true
| false
Whether to use bold for the link text, specified as true
or false
. A setting of true
renders text in bold.
Attributes:
NonCopyable | true |
Data Types: logical
Font
— Font family for link text
[]
(default) | character vector | string scalar
Font family for the link 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:
NonCopyable | true |
Attributes:
NonCopyable | true |
ComplexScriptFont
— Font family for complex scripts
[]
(default) | character vector | string scalar
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:
NonCopyable | true |
Data Types: char
| string
FontColor
— Font color for link text
[]
(default) | character vector | string scalar
Font color for the link text, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.
For a list of CSS color names, see https://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.
Attributes:
NonCopyable | true |
Data Types: char
| string
FontSize
— Font size for link text
[]
(default) | character vector | string scalar
Font size for the link text, specified as a character vector or string scalar that consists of 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:
NonCopyable | true |
Data Types: char
| string
Italic
— Whether to use italic for link text
[]
(default) | true
| false
Whether to use italic for the link text, specified as true
or false
. A setting of true
renders text in italic.
Attributes:
NonCopyable | true |
Data Types: logical
Strike
— Strikethrough style for link text
[]
(default) | 'single'
| 'none'
| 'double'
Strikethrough style for the link text, specified as one of these values:
'single'
— Single horizontal line'none'
— No strikethrough line'double'
— Double horizontal line
Subscript
— Whether to display link text as a subscript
[]
(default) | true
| false
Whether to display the link text as a subscript, specified as true
or false
. A setting of true
renders text as a
subscript.
Attributes:
NonCopyable | true |
Data Types: logical
Superscript
— Whether to display link text as a superscript
[]
(default) | true
| false
Whether to display the link text as a superscript, specified as
true
or false
. A setting of
true
renders text as a superscript.
Attributes:
NonCopyable | true |
Data Types: logical
Underline
— This property is ignored
[]
(default)
This property is ignored.
Attributes:
NonCopyable | true |
Style
— Link text formatting
[]
(default) | cell array of PPT format objects
Link text formatting, specified as a cell array of PPT format objects.
Add format objects by concatenating the existing value of the
Style
property with a cell array that contains the format objects
that you are adding. For
example:
link = mlreportgen.ppt.InternalLink(3,'link text');
link.Style = [link.Style {Bold(true)}];
See Presentation Formatting Approaches.
Attributes:
NonCopyable | true |
Parent
— Parent of mlreportgen.ppt.InternalLink
object
PPT API object
Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.
Attributes:
SetAccess | private |
NonCopyable | true |
Children
— This property is ignored
not applicable
The class ignores this property.
Attributes:
SetAccess | private |
NonCopyable | true |
Tag
— Tag for mlreportgen.ppt.InternalLink
object
character vector | string scalar
Tag for the mlreportgen.ppt.InternalLink
object, 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. Specify your own tag value to help
you identify where to look when an issue occurs during document generation.
Attributes:
NonCopyable | true |
Data Types: char
| string
Id
— Object identifier for mlreportgen.ppt.InternalLink
object
character vector | string scalar
Object identifier for the mlreportgen.ppt.InternalLink
object, 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:
NonCopyable | true |
Data Types: char
| string
Methods
Public Methods
clone |
Use the |
Examples
Link to Slide Using the Target Slide Name
This example links to a slide using an mlreportgen.ppt.InternalLink
object that specifies the target slide name.
Create the presentation.
import mlreportgen.ppt.* ppt = Presentation("myPresentation1.pptx"); open(ppt);
Add a slide to the presentation.
slide1 = add(ppt,"Title and Content");
Choose a name to identify the target slide.
targetSlideName = "myTargetSlide";
Create a paragraph. Create an InternalLink
object that specifies the target slide by name and append it to the paragraph.
p = Paragraph("This is a link to the slide with the name ");
linkObj = InternalLink(targetSlideName,targetSlideName);
append(p,linkObj);
Add the title and content to the slide.
replace(slide1,"Title","First slide"); replace(slide1,"Content",p);
Add a second slide to the presentation.
slide2 = add(ppt,"Title and Content"); replace(slide2,"Title","Second slide");
Add the target slide to the presentation. Set the Name
property of the slide to the name specified in the InternalLink
object.
slide3 = add(ppt,"Title and Content"); slide3.Name = targetSlideName; replace(slide3,"Title","Third slide"); content = strcat("This is the target slide with the name ",targetSlideName); replace(slide3,"Content",content);
Close and view the presentation.
close(ppt); rptview(ppt);
Here are the generated slides:
Link to a Slide Using the Target Slide Index
This example links to a slide using an mlreportgen.ppt.InternalLink
object that specifies the target slide number.
Create the presentation.
import mlreportgen.ppt.* ppt = Presentation("myPresentation2.pptx"); open(ppt);
Add a slide to the presentation.
slide1 = add(ppt,"Title and Content");
Create a paragraph. Create an InternalLink
object that specifies the target slide by its index and append the object to the paragraph.
p = Paragraph("This is a link to "); link = InternalLink(3,"slide 3"); append(p,link);
Add the title and content to the slide.
replace(slide1,"Title","First slide"); replace(slide1,"Content",p);
Add a slide 2 to the presentation.
slide2 = add(ppt,"Title and Content"); replace(slide2,"Title","Second slide");
Add the target slide, slide 3, to the presentation.
slide3 = add(ppt,"Title and Content"); replace(slide3,"Title","Third slide"); replace(slide3,"Content","This is the target slide");
Close and view the presentation.
close(ppt); rptview(ppt);
Here are the generated slides:
Version History
Introduced in R2021a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)