Get text Version 1 (Python)

Action group: Office


Description

The action takes all the text from 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
Results
ResultText retrieved from documentRobin.String

Special conditions of use

None.

Example of use

Task 

There is a file test (2).docx. with name records. It is necessary to get the text of the document into a variable of type "String". Then, save the document and close it. 

Solution

Use the "Open", "Get text", "Save", "Close" actions.

Implementation

  1. Move the "Open" action to the workspace and set its parameters.
    In the "Path to file" field specify the path to file test (2).docx.



  2. Move the "Get text" action to the workspace and set its parameters
    In the "Context" field, specify the context created in step 1.
    In the "Result" field, specify the text variable created earlier. 

  3. Move the "Save" action to the workspace and set its parameter.
    In the context field specify the context of the open document.
  4. Move the "Close" action to the workspace and set its parameter.


  5. Click "Start" in the top panel.

Result

The program robot completed successfully.

Text is saved from the document to the variable "Text". The file is saved and closed.

  • Нет меток