订阅

UiPath 活动

UiPath 活动指南

Insert DataTable in Document

UiPath.Word.Activities.WordInsertDataTable

描述

在 Word 文档中插入由“DataTable”变量生成的表格。该活动会在与指定文本或书签相对的位置创建表格。该活动只能用于“Word 应用程序作用域”活动。

属性

Common

  • DisplayName - The display name of the activity.

Input

  • “数据表”- 要用于创建表格的“DataTable”变量。该字段仅支持“DataTable”变量。

插入选项

  • “书签”- 此为书签名称,用于指定要在其中插入表格的位置。该字段仅支持字符串和字符串变量。

Important!

在“书签”字段中插入的值不能超过 40 个字符。

  • “出现位置”- 指定要将目标元素的哪些出现位置用作表格的位置。可用的选项如下:“全部”- 在该元素的每个出现位置插入表格,“第一个”- 在该元素的第一个出现位置插入表格,“最后一个”- 在该元素的最后一个出现位置插入表格,“特定”- 在“出现位置索引”属性指定的元素出现位置插入表格。
  • “出现位置索引”- 以“Int32”变量形式指定要在其中插入表格的目标元素出现位置。仅在“出现位置”属性设置为“特定”时,再考虑使用该属性字段。该字段仅支持“Int32”变量。
  • “位置”- 指定相对于目标元素要插入表格的位置。可用的选项如下:“开头”- 文档开头,“结尾”- 文档结尾,“之前”- 目标元素之前,“之后”- 目标元素之后,“替换”- 将目标元素替换为表格。
  • “文本”- 此文本用于指定要在其中插入表格的位置。该字段仅支持字符串和字符串变量。

Important!

在“文本”字段中插入的值不能超过 256 个字符。

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

“插入数据表”活动使用示例

为举例说明该活动的具体用法,我们构建了一个自动化项目,用于展示该活动的三种不同应用情形:

  1. 通过“构建数据表”活动检索表格,并将其插入文档开头。
  2. 从 Excel 工作簿检索表格,并在指定文本的第一个出现位置之后插入此表格。
  3. The table is retrieved from a Build Datatable activity and replaces the third occurrence of a specific text.

您可在此处下载该工作流。

UiPath.Word.Activities.WordInsertDataTable

描述

Copies a range from Excel or saved for later table data and inserts it as a table in a Word document at a specified position relative to a text or bookmark. This activity must be added inside a Use Word File activity.

To learn how to use this activity, see Tutorial: Working with Word Automation.

配置活动

In the Body of the Activity

  • Table to insert - Click Plus plus button next to the field, select the Project Notebook or a parent Excel file, and then a range, table, or sheet to insert in the Word document, or click Indicate in Excel to select a range directly from the file. Alternatively, you can select a data table value that you previously saved for later use in the project. or Open in Advanced Editor and enter a VB expression.

To Insert the Table at the Start or at the End of the Document

  • Insert relative to - Select Document.
  • Position where to insert - Select the position in the document where to insert the table: at the Start or at the End of the document.

To Insert the Table Relative to a Specific Bookmark in the Document

  • Insert relative to - Select Bookmark.
  • Bookmark to search for - Click Plus plus button on the right side of the field, and then, from the menu, select Text to enter the name of the bookmark relative to which to add the table in the Text Builder. Alternatively, choose one of the other available options in menu to indicate the bookmark name:
    • Data from the Project Notebook, a parent Excel file or Outlook account. For example, select an Excel file and then select a cell that contains the bookmark name, or indicate a field from a selected email in Outlook that contains the name.
    • Use Saved Value - Select a value that you previously saved for later use in the project.
    • Ask when run - Prompt for the bookmark name when the project is executed.
    • Open in Advanced Editor - Enter a VB expression.

Important!

The Bookmark to search for value cannot be longer than 40 characters.

  • Text occurrence - Select All to insert the table relative to every occurrence of the bookmark name.
  • Position where to insert - Select the position where to insert the table: Before, After, or in place of (Replace) the specified bookmark.

To Insert the Table Relative to a Specific Text in the Document

  • Insert relative to - Select Text.
  • Text to search for - Click Plus plus button on the right side of the field, and then, from the menu, select Text to enter the text relative to which to add the table in the Text Builder. Alternatively, choose one of the other available options in menu to indicate the text:
    • Data from the Project Notebook, a parent Excel file or Outlook account. For example, select an Excel file and then select a cell that contains the text to add, or indicate a field from a selected email in Outlook that contains the text.
    • Use Saved Value - Select a value that you previously saved for later use in the project.
    • Ask when run - Prompt for the text to add when the project is executed.
    • Open in Advanced Editor - Enter a VB expression.

Important!

The Text to search for value cannot be longer than 256 characters.

  • Text occurrence - Select the occurrences of the specified text relative to which to insert the table:
    • All - Insert the table relative to every occurrence of the text.
    • First - Insert the table relative to the first occurrence of the text.
    • Last - Insert the table relative to the last occurrence of the text.
    • Specific - Insert the table relative to a specific occurrence of the text. To indicate the occurrence, select Plus plus button next to the Occurrence index field, and then select Number. For example, if the text to search for appears five times in the document and you want to insert the table after the second occurrence of the text, the Occurrence index should be set to 2.
  • Position where to insert - Select the position where to insert the table: Before, After, or in place of (Replace) the specified text.

In the Properties Panel

Common

  • DisplayName - The name displayed for the activity in the Designer panel.

Input

插入选项

Misc

  • Private - If selected, the data used in the activity is not logged by StudioX.

Updated 4 months ago


Insert DataTable in Document


建议的编辑仅限用于 API 参考页面

You can only suggest edits to Markdown body content, but not to the API spec.