Create and Format Links

Create an External Link

To create a link to a location outside of a presentation, use the mlreportgen.ppt.ExternalLink constructor. Specify the full URL of the link target and specify the link text as a character vector. For example:

import mlreportgen.ppt.*

slidesFile = 'myExternalLinkPresentation.pptx';
slides = Presentation(slidesFile);

add(slides,'Title and Content');

p = Paragraph('This is a link to the ');
link = ExternalLink('https://www.mathworks.com','MathWorks site.');

append(p,link);
replace(slides,'Content',p);

close(slides);

if ispc
    winopen(slidesFile);
end

Format an External Link

To specify default formatting for the link text, use the Style property with format objects.

ExternalLink Object Formatting Format ObjectFormat Property

Font family

FontFamily

n/a

Font family for complex scripts to handle locales

FontFamily

n/a

Text color

FontColor

n/a

Font size

FontSize

n/a

Bold

Bold

n/a

Italic

Italic

n/a

Strike

Strike

n/a

Underline

Underline

n/a

Background color

BackgroundColor

n/a

See Also

Classes

Related Topics