activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity Activities

Last updated Jun 12, 2025

PREVIEW
Insert DataTable in Document

UiPath.Word.Activities.WordInsertDataTable

Description

Inserts a table generated from a DataTable variable 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, check Tutorial: Working with Word Automation.

Project compatibility

Windows - Legacy | Windows | Cross-platform

Windows configuration

In the Body of the Activity
  • DataTable - Enter the DataTable object that you previously saved for later use in the project or open in Expression Editor and enter a VB expression.
  • Insert relative to - Select one of the following: Document, Bookmark, Text.
  • Position - The position in the document where to add the image. Select one of the following: Start, End, Before, After, Replace.

Cross-platform configuration

  • File - The complete path to the document file.
  • DataTable - Enter the DataTable object that you previously saved for later use in the project or open in Expression Editor and enter a VB expression.
  • Insert relative to - Select one of the following: Document, Bookmark, Text.
  • Position - The position in the document where to add the image. Select one of the following: Start, End, Before, After, Replace.

Examples

Inserting a table at the start or end of a document

  • Insert relative to - Select one of the following: Document.
  • Position - The position in the document where to add the table. Select one of the following, depending on your case: Start or End.

Inserting a table relative to a specific bookmark in a document

  • Insert relative to - Select Bookmark.
  • Bookmark - Enter the name of the bookmark relative to which to add the table. Alternatively, choose one of the other available options in menu to indicate the bookmark name

  • Position - Select the position where to add the table: BeforeAfter, or Replace the specified bookmark.

Inserting a table relative to a specific text in a document

  • Insert relative to - Select Text.
  • Text- Enter the text relative to which to add the table.
  • Occurrence - Select the occurrences of the specified text relative to which to add the table:
    • All - Add the table relative to every occurrence of the text.
    • First - Add the table relative to the first occurrence of the text.
    • Last - Add the table relative to the last occurrence of the text.
    • Specific - Add the table relative to a specific occurrence of the text.
      • OccurrenceIndex - Enter the specific occurrence of the text. For example, if the text to search for appears five times in the document and you want to add 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 add the table: BeforeAfter, or Replace the specified text.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.