Main Content

Add Holes in aMicrosoftWordTemplate

洞sare placeholders in a template that are filled with content as you generate a report. Use holes for dynamic content in a report. You can create two types of holes in aMicrosoft®Word报告:

  • Inline hole——内容的占位符,一段contain, such as text, an image, or a link.

  • 块孔- 段落无法包含的内容的占位符,例如表或列表。块孔还可以包含内联孔可以包含的内容,但是在单词报告中,内容包裹在段落中。

要在单词模板中添加孔,请使用丰富的文本内容控件。在添加孔之前,请查看段落和格式化符号,并显示Developertab.

打开Word Template

打开the Word template file by using one of these methods:

  • In MATLAB®, in theCurrent Folderpane, right-click the template file and click在Matlab外面打开

  • Outside of MATLAB, right-click the template file and click打开

笔记

Do not double-click a Word template file to open it. Double-clicking the file opens a Word document file that uses the template.

Display Formatting Symbols

To make paragraph and formatting symbols visible in Word, on thetab, in the段落小组,单击显示隐藏按钮

The Home tab of the Word ribbon with an annotation that identifies the Show/Hide button

格式符号可帮助您查看孔是内联孔还是块孔。

Display the Developer Tab

在可以向单词模板添加一个孔之前,您必须显示Developertab.

If theDevelopertab is not available, clickFile>选项, and then click自定义功能区。在下面Main Tabs, click theDeveloper复选框。

小费

If you do not see theDeveloper列表中的复选框,设置自定义色带Main Tabs

When you create a hole, you use these controls on theDevelopertab:

  • 设计模式

  • 丰富的文本内容控制

  • 特性

“开发人员”选项卡上的控件组,并带有注释,可以识别丰富的文本内容控制,属性控制和设计模式控制

使用丰富的文本内容控制添加一个孔

Add a hole to a Word template by using a rich text content control.

If you add a rich text content control with formatting symbols displayed and设计模式已启用,您可以判断您是在创建块还是内联孔。对于一个块孔:

  • The control bounding box includes a paragraph symbol.

  • 控制启动和结束标签分别包含左点和右点三角形。要查看三角形,请打开Word Document看法tab and clickingZoom

这是块孔的丰富文本控制的示例:

单词丰富的文本控制文档主体中有孔标记的块孔可见

对于内联孔:

  • 控制边界框不包括段落符号。

  • 控制启动和结束标签不包括三角形。

这是一个内联孔的丰富文本控制的示例:

Word Rich Text Control for an inline hole with holes marks visible

您用来添加丰富文本内容控件的过程取决于您是添加内联还是块孔,以及是否要在文档正文中还是在表单元格中添加孔。

Add an Inline Hole in a Document Body Paragraph

  1. Developer标签,确保设计模式is enabled. In this mode, when you create a hole, you can see the hole marks with the title tag.

  2. 点击in a paragraph where you want to create an inline hole. Add several blank spaces in front of the paragraph mark to make sure that you create an inline hole, not a block hole.

  3. 点击in front of the spaces.

  4. 点击the丰富的文本内容控制按钮。A rich text content control appears at the insertion point.

    Word Rich Text Control for an inline hole with holes marks visible

    您可以说您正在创建一个内联孔,因为边界框不包括段落标记,并且开始和结束标签不包括三角形。

  5. 单击孔,然后单击特性

  6. In the内容控制属性对话框:

    • In the标题field, enter an ID for the hole. Use this value to identify the hole in your report generation program or custom reporter class.

    • In theTagfield, enter

    • Optionally, set the default style for text that fills the hole. See为填充孔的文本指定默认样式

  7. 点击OK

  8. 删除您在段落前添加的空间。

在文档主体中添加一个块孔

  1. Developer标签,确保设计模式is enabled. In this mode, when you create a hole, you can see the hole marks with the title tag.

  2. 创建一个空的段落,在其中您要创建一个块孔。创建段落可确保您创建一个块孔,而不是内联孔。如果您在文档的末尾,请在现有的空段落之前创建一个空段落。

  3. 选择您添加的空段落。

  4. 点击the丰富的文本内容控制按钮。出现丰富的文本内容控制。

    单词丰富的文本控制文档主体中有孔标记的块孔可见

    You can tell that you are creating a block hole because the bounding box includes the paragraph mark and the start and end tags include triangles.

  5. 单击孔,然后单击特性

  6. In the内容控制属性对话框:

    • In the标题field, enter an ID for the hole. Use this value to identify the hole in your report generation program or custom reporter class.

    • In theTagfield, enter

    • Optionally, set the default style for text that fills the hole. See为填充孔的文本指定默认样式

  7. 点击OK

Add an Inline Hole in a Table Entry

  1. Developer标签,确保设计模式is enabled. In this mode, when you create a hole, you can see the hole marks with the title tag.

  2. 要将内联孔添加到表条目中,必须在条目中的段落内添加孔。每个单词表条目都是段落,但是,段落标记不可见。为了确保您在段落中添加孔,并且您不在孔中包含默认的表单元格,请在空表条目中添加一些空间。

  3. 点击in front of the spaces.

  4. 点击the丰富的文本内容控制按钮。A rich text content control appears at the insertion point.

    单词丰富的文本控制,用于带有孔标记的表条目中的内联孔

    You can tell that you are creating an inline hole because the hole bounding box does not include a paragraph or table entry mark and the start and end tags do not include triangles.

  5. 点击the hole and then, click特性

  6. In the内容控制属性对话框:

    • In the标题field, enter an ID for the hole. Use this value to identify the hole in your report generation program or custom reporter class.

    • In theTagfield, enter

    • Optionally, set the default style for text that fills the hole. See为填充孔的文本指定默认样式

  7. 点击OK

  8. Delete the spaces that you added.

在桌子条目中添加一个块孔

  1. Developer标签,确保设计模式is enabled. In this mode, when you create a hole, you can see the hole marks with the title tag.

  2. To ensure that you create a hole that includes a paragraph and does not include the default table cell, add an empty paragraph to the table entry.

  3. 选择您添加的空段落。

  4. 点击the丰富的文本内容控制按钮。A rich text content control appears at the insertion point.

    单词丰富的文本控制,用于可见孔标记的桌子条目中的一个块孔

    You can tell that you are creating a block hole because the hole bounding box includes the paragraph mark and the start and end tags include triangles. You can tell that the hole does not include the default cell because the bounding box does not include the table entry mark.

  5. 单击孔,然后单击特性

  6. In the内容控制属性对话框:

    • In the标题field, enter an ID for the hole. Use this value to identify the hole in your report generation program or custom reporter class.

    • In theTagfield, enter

    • Optionally, set the default style for text that fills the hole. See为填充孔的文本指定默认样式

  7. 点击OK

笔记

桌子上的孔不支持万博1manbetxDocumentPart元素。

为填充孔的文本指定默认样式

You can specify a default style for text that fills a hole. Text formatting that you specify in your report generation program overrides the default style. See报告格式的方法。默认文本样式适用于填充内联孔的文本,以及填充块孔的文本或段落。它不适用于其他报告元素(例如表)中可以填充块孔的文本。

要指定填充孔的文本的默认样式,内容控制属性对话框:

  1. 选择the使用样式格式化输入空控件的文本复选框。

  2. Stylelist or clickNew Style至create a style.

    For text in a paragraph, make sure that the style applies to a paragraph. If you create a style, in theCreate New Style from Formattingdialog box, forStyle type, 选择Linked (paragraph and character)

Related Topics