mlreportgen.dom.EmbeddedObject Class
Namespace: mlreportgen.dom
Superclasses: mlreportgen.dom.ExternalLink
Description
Use an object of the mlreportgen.dom.EmbeddedObject
class to embed a file
in a document. The advantage of embedding a file in a document, instead of linking to it, is
that you can move the document without moving the target file.
You can append an mlreportgen.dom.EmbeddedObject
object to objects of these
DOM classes:
mlreportgen.dom.Document
mlreportgen.dom.DocumentPart
mlreportgen.dom.Paragraph
mlreportgen.dom.TableEntry
mlreportgen.dom.TableHeaderEntry
mlreportgen.dom.ListItem
The effect of appending an EmbeddedObject
object to a DOM object depends on
the document output type and the external file type, as described in this table.
Document Output Type | External File Type | Behavior |
---|---|---|
Word | xlsx , pptx ,
docx | Embeds the external file in the document and inserts an Object Linking and Embedding (OLE) link to the embedded file. If you open the
document without first opening it with |
Word | Any type except xlsx , pptx , or
docx | Does not embed the file in the document. Inserts a hyperlink to the external file. |
Any | Embeds the external file in the document and inserts an annotation that has a paper clip icon. To open the embedded file, double-click the icon. To see the paper clip icon, you must open the PDF outside of
MATLAB®. If you still do not see the paper clip icon, try opening the PDF
using a different PDF viewer, such as Adobe®
Acrobat®. If you need to open the PDF using a viewer that does not display
the paper clip icon, instead of embedding the document, consider linking to the
document by using an | |
HTML | Any | Embeds the external file in the document and inserts a hyperlink to the embedded file. In an HTML document, the hyperlink works only if you open the document outside of MATLAB. |
Single-file HTML | Any | Does not embed the file in the document. Inserts a hyperlink to the external file. The hyperlink works only if you open the document outside of MATLAB. |
The mlreportgen.dom.EmbeddedObject
class is a handle
class.
Class Attributes
ConstructOnLoad | true |
HandleCompatible | true |
For information on class attributes, see Class Attributes.
Creation
Description
creates
an empty embObj
= mlreportgen.dom.EmbeddedObject() EmbeddedObject
object. To specify the file to embed, use the
Target
property.
also specifies the link text. The link text applies only when the reference to a file is a
hyperlink. This constructor creates an embObj
= mlreportgen.dom.EmbeddedObject(path
,linkText
)mlreportgen.dom.Text
object to hold the link text.
specifies the name of the template-defined style to use for the link text. This
constructor creates an embObj
= mlreportgen.dom.EmbeddedObject(path
,linkText
,styleName
)mlreportgen.dom.Text
object to hold the link
text and sets the StyleName
property of the Text
object to styleName
.
uses an embObj
= mlreportgen.dom.EmbeddedObject(path
,linkTextObj
) mlreportgen.dom.Text
object to specify the link text.
Input Arguments
Properties
Methods
Examples
Alternative Functionality
mlreportgen.dom.DOCXSubDoc
To insert Word documents into another document, you can use objects of the
DOCXSubDoc
or EmbeddedObject
class. To decide which class to
use, consider these guidelines:
Use
DOCXSubDoc
objects if you want the parent document to display links to subdocuments initially. You might want to display links initially when the parent document links to a set of subdocuments in an outline view. UseEmbeddedObject
objects if you want the parent document to display the subdocument contents regardless of whether you open the parent document in Word or by usingrptview
.Use
EmbeddedObject
objects if you want to move the parent document without moving the subdocuments.