主要内容

mlreportgen.dom.docxsubdocclass

Package:mlreportgen.dom

引用外部MicrosoftWorddocument

Description

使用一个对象mlreportgen.dom.docxsubdoc班级创建对外部的参考Microsoft®Word单词,PDF或HTML文档中的文档。指向引用文档的链接(也称为subdocument)插入在父档中,您可以在其中附加DOCXSubDoc目的。

When you initially open the parent document in Word, Word displays the link to the subdocument instead of the content. To replace the link with the content, selectExpand Subdocumentsfrom the概述tab of theViewtab on the Word toolstrip. Therptviewcommand expands subdocuments when it opens a Word document. You can also usedocviewto expand and unlink subdocuments.

Themlreportgen.dom.docxsubdoc班级是handleclass.

Class Attributes

ConstructOnLoad
真的
HandleCompatible
真的

For information on class attributes, seeClass Attributes.

Creation

Description

docxSubDocObj= mlreportgen.dom.DOCXSubDoc()creates an empty document reference.

example

docxSubDocObj= mlreportgen.dom.DOCXSubDoc(path)在指定路径上创建对Word文档的引用,并设置Targetproperty topath.

Properties

expand all

ID for this DOM API object, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Attributes:

GetAccess
上市
SetAccess
上市
NonCopyable
真的

Tag for this DOM API object, specified as a character vector or string scalar.

The DOM 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 theIdproperty of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

Attributes:

GetAccess
上市
SetAccess
上市
NonCopyable
真的

该参考针对的文档的路径, specified as a character vector or string scalar. Use ASCII characters. Use the following format for specifying a full path involving a mapped drive.

'file:///C:/UserPath/FileName.docx'

Attributes:

GetAccess
上市
SetAccess
immutable
Transient
真的
NonCopyable
真的

方法

expand all

Examples

collapse all

importmlreportgen.dom.*info = Document('CompanyInfo','docx'); append(info,'XYZ, Inc., makes widgets.'); close(info); infoPath = info.OutputPath; rpt = Document('Report','docx'); open(rpt); append(rpt,Paragraph('About XYZ, Inc.')); append(rpt,DOCXSubDoc(infoPath)); close(rpt); rptview(rpt.OutputPath);

替代功能

mlreportgen.dom.EmbeddedObject

要将文档以外的其他文档插入另一个文档,请使用mlreportgen.dom.EmbeddedObjectclass.

To insert Word documents into another document, you can use objects of theDOCXSubDoc或者EmbeddedObjectclass. To decide which class to use, consider these guidelines:

  • 利用DOCXSubDoc对象如果您希望父文档最初显示针对子登录的链接。当父文档链接到轮廓视图中的一组子插图时,您可能需要最初显示链接。利用EmbeddedObjectobjects if you want the parent document to display the subdocument contents regardless of whether you open the parent document in Word or by usingrptview.

  • 利用EmbeddedObjectobjects if you want to move the parent document without moving the subdocuments.

版本历史

在R2014b中引入