UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

生产力活动

上次更新日期 2026年4月27日

操作 Word 文档

下面的示例说明了如何使用Word 应用程序作用域 / 使用 Word 文件读取文本附加文本添加图片,或将文档另存为 PDF 。您可以在“UiPath.Word.Activities”包中找到这些活动。

备注:

Download the example presented on this page in order to have access to all the files needed as Input for the explained workflow.

此自动化流程的构建方法如下:

  1. 打开 Studio ,创建一个新“流程”
  2. 将“序列”容器拖动至“工作流设计器”
    • 创建以下变量:

      变量名称变量类型默认值
      sourceDocument字符串"Raw Text.docx"
      destinationDocument字符串"About Samoyed.docx"
      rawTextFromSource字符串不适用
  3. Drag a Word Application Scope activity inside the Sequence container.
    • Add the variable sourceDocument in the Document path field.
  4. Drag a Read Text activity inside the Word Application Scope activity.
    • 在“文本”字段中添加“rawTextFromSource”变量。
  5. Drag a Word Application Scope activity below the previous Word Application Scope activity.
    • Add the variable destinationDocument in the Document path field.

    • Select the Do container and create the following variables:

      变量名称变量类型默认值
      picturePath字符串"Samoyed Picture.jpg"
      exportedDocToPdf字符串"About Samoyed.pdf"
  6. Drag an Append Text activity inside the Do container of the Word Application Scope activity.
    • 在“文本”字段中添加“rawTextFromSource”变量。
  7. Drag an Add Picture activity below the Append Text activity.
    • In the Properties panel, add the variable picturePath in the PicturePath field.
  8. Drag an Export To PDF activity below the Add Picture activity.
    • Add the variable exportedDocToPdf in the File path field.
  9. 运行流程。 机器人从一个文档中读取文本,将其写入另一个文档,然后添加图片。 并将其从 Word 转换为 PDF。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新