UiPath Documentation
activities
latest
false

Produktivitätsaktivitäten

Letzte Aktualisierung 27. Apr. 2026

Word-Dokumente verwalten

Im folgenden Beispiel wird erklärt, wie Sie ein Word-Dokument anpassen können, indem Sie den Text aus der Datei lesen, ihn in einem Meldungsfeld anzeigen, Text anfügen und Text ersetzen, ohne Microsoft Word überhaupt zu öffnen. Im Beispiel werden Aktivitäten wie Read Text, Append Text oder Replace Text in Document verwendet. Diese Aktivitäten finden Sie im Paket UiPath.Word.Activities.

So kann der Automatisierungsprozess erstellt werden:

  1. Öffnen Sie Studio und erstellen Sie einen neuen Prozess.

  2. Download and extract the archive with the project in this example and copy the file document.docx to your project folder.

  3. Ziehen Sie einen Sequence-Container in den Workflow-Designer.

    • Erstellen Sie die folgende Variable:

      VariablennameVariablentypStandardwert
      textStringKeine Angabe
  4. Drag a Message Box activity inside the Sequence container.

    • Fügen Sie den Ausdruck "This is the original document." in das Feld Text ein.
  5. Drag a Read Text activity below the Message Box activity.

    • Add the expression "document.docx" in the File path field.
    • Fügen Sie die Variable text in das Feld Text ein.
  6. Drag a Message Box below the Read Text activity.

    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Fügen Sie die Variable text in das Feld Text ein.
    • Select the check box for the TopMost option. This always brings the message box to the foreground.
  7. Drag a Message Box below the previous Message Box activity.

    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Fügen Sie den Ausdruck "A new paragraph is added" in das Feld Text ein.
    • Select the check box for the TopMost option. This always brings the message box to the foreground.
  8. Drag an Append Text activity below the Message Box activity.

    • Add the expression "document.docx" in the File path field.
    • Add the following expression in the Text field: "Nulla eu arcu a urna ultrices scelerisque nec in lectus. Suspendisse iaculis cursus turpis. Sed sed nibh in augue molestie egestas sit amet ac justo. Suspendisse facilisis, mi scelerisque mattis elementum, leo nisi euismod turpis, sed consequat nibh nulla non ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean mauris risus, aliquam vel tristique blandit, consectetur ac nunc. Phasellus convallis dolor ligula, non auctor nulla lobortis sit amet. Nulla eu lectus fermentum, porttitor metus in, consectetur ex. Vivamus gravida justo et auctor fermentum. Cras nisl urna, blandit et elementum sit amet, sodales ut tellus. In sit amet semper lectus. Donec ac ipsum vel libero mattis porta vitae id velit. Nullam facilisis porttitor elementum. Ut congue tristique nisi, ornare porta enim mattis eu. Donec in lacus risus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.".
    • Select the check box for the New line option.
  9. Drag a Read Text activity below the Append Text activity.

    • Add the expression "document.docx" in the File path field.
    • Fügen Sie die Variable text in das Feld Text ein.
  10. Drag a Message Box below the Read Text activity.

    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Add the value text in the Text field.
    • Select the check box for the TopMost option. This always brings the message box to the foreground.
  11. Drag a Message Box below the previous Message Box activity.

    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Add the value "Replace all the occurrences of the word "lorem" with "REPLACED"" in the Text field.
    • Select the check box for the TopMost option. This always brings the message box to the foreground.
  12. Drag a Replace Text activity below the Message Box activity.

    • Add the expression "document.docx" in the File path field.
    • Add the value "REPLACED" in the Replace field.
    • Add the value "lorem" in the Search field.
  13. Drag a Read Text activity below the Replace Text activity.

    • Add the expression "document.docx" in the File path field.
    • Fügen Sie die Variable text in das Feld Text ein.
  14. Drag a Message Box activity below the Read Text activity.

    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Add the value text in the Text field.
    • Select the check box for the TopMost option. This always brings the message box to the foreground.
  15. Drag a Message Box activity below the previous Message Box activity.

    • In the Properties panel, select the Ok option from the Buttons drop-down list.

    • Add the value "This activity doesn't need to open Word to interact with it. Thank you and goodbye!" in the Text field.

    • Select the check box for the TopMost option. This always brings the message box to the foreground.

    • So sollte Ihr Workflow aussehen:

      Dokumentationsbild

  16. Führen Sie den Prozess aus. Mehrere Meldungsfelder zeigen den Originaltext des Dokuments, den Text mit dem hinzugefügten Absatz und den Text mit dem ersetzten Wort an.

War diese Seite hilfreich?

Verbinden

Benötigen Sie Hilfe? Support

Möchten Sie lernen? UiPath Academy

Haben Sie Fragen? UiPath-Forum

Auf dem neuesten Stand bleiben