mlreportgen.dom.StyleRef 类
命名空间: mlreportgen.dom
用于引用具有指定样式名称或大纲级别的内容的占位符
描述
为具有指定样式名称或大纲级别的内容的引用创建占位符。此对象适用于 Word 和 PDF 报 告。
对于 Microsoft® Word 文档,您可以将 StyleRef
对象追加到页眉、页脚或正文中。对于 PDF,您只能将 StyleRef
对象追加到页眉或页脚。
提示
使用 StyleRef
对象在文档中创建页眉和页脚。例如,您可以使用此对象在页眉中添加当前章节的标题。
mlreportgen.dom.StyleRef
类是一个 handle
类。
创建对象
描述
创建对最接近此对象的段落内容的引用,该对象的 styleref
= StyleRefOutlineLevel
属性为 1
。
在 Word 输出的页眉中,最近的段落是当前页面上具有指定大纲级别的第一个段落。如果当前页面上没有这样的段落,则最近的段落是当前页面之前或之后页面上具有指定大纲级别的第一个段落。
在 Word 输出的页脚中,最近的段落是当前页面上具有指定大纲级别的最后一个段落。如果当前页面上没有这样的段落,则最近的段落是当前页面之前或之后页面上具有指定大纲级别的第一个段落。
PDF 输出的页眉和页脚中,最近的段落是当前页面的第一个段落,或当前页面布局部分中当前页面之前或之后的页面上的第一个段落。
创建对最接近此对象的段落内容的引用,该段落的 styleref
= StyleRef(num
)OutlineLevel
属性具有指定的级别。
输入参量
属性
方法
示例
版本历史记录
在 R2016a 中推出