Insert data table Version 1 (Python)

Action group: Office


Description

The action adds a data table to the document

Action icon

image2024-1-15_13-12-0.png

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextContext for working with a documentRobin.OpenTextDo c
Yes
TableVariable of type Data Table with dataRobin.DataTable
Yes
Add text toLocation in document where table should be inserted toRobin.String
Yes
Bookmark nameThe name of the bookmark after which the table will be addedRobin.String
No

Special conditions of use

None.

Example of use

Task 

There is a file test.docx. It is necessary to open the document and insert a table with data (the data is written to the variable "Table"). Then, save the document and close it. 

Solution

Use the "Open", "Insert data table", "Save", "Close" actions.

Implementation

  1. Assemble a robot scheme consisting of actions:
  2. Fill in the "Open" action parameter. 
    In the "Path to file" field specify the path to the file test.docx


  3. Set the parameters for the "Insert data table" action: 
    In the "Context" field specify the context created in step 1
    In the "Table" field specify a variable of the "table" type containing the table with data.
    In the "Add text to" field specify the value "End of the document". 

  4. Set the parameter for the "Save" action. 
    In the "Context" field specify the context of the opened document.

  5. Move the "Close" action to the workspace and set its parameter.


  6. Click "Start" in the top panel.

Result

The program robot completed successfully.

The table is added to the document. The file is saved and closed.


  • Нет меток