UiPath Documentation
studiox
2022.10
false
StudioX 用户指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

教程:从 CSV 复制到 Excel 并通过电子邮件发送文件

在本教程中,我们会将 CSV 文件中的数据复制到现有的 Excel 文件,然后将 Excel 文件附加到电子邮件并从 Outlook 发送电子邮件。

我们将创建一个项目,并首先添加一个“使用 Excel 文件”活动以指明要从中复制数据的 Excel 文件。在该活动内,我们将添加一个“读取 CSV”活动,以指明要从中复制数据的 CSV 文件以及要复制到的 Excel 文件中的位置。然后,我们将添加一个“使用桌面 Outlook 应用”活动以指明要使用的 Outlook 帐户,并在其中添加一个“发送电子邮件”活动以发送电子邮件。

  1. 第 1 步:设置项目并获取必要的文件。

    1. Create a new blank project using the default settings.
    2. Download and extract the archive with the automation project in this example using the button at the bottom of this page, then copy the files A.csv and B.xlsx to your project folder.
  2. 步骤 2:将 Excel 文件添加到项目中。

    1. Click Add activity 文档图像 in the Designer panel, and then find the Use Excel File activity in the search box at the top of the screen and select it. A Use Excel File activity is added to the Designer panel.

    2. 在活动中:

      • Click Browse文档图像 next to the Excel file field, and then browse to and select the file B.xlsx

      • 在“引用为”字段中,输入 ExcelB。

        您已指明将使用自动化中称为“ExcelB”的文件“B.xlsx”。

  3. 步骤 3:添加活动以将 CSV 文件中的数据复制到 Excel 文件。

    1. Click Add activity 文档图像 inside the Use Excel File activity, and then find the Read CSV activity in the search box at the top of the screen and select it. The activity is added inside the Use Excel File activity.

    2. In the Read CSV activity:

      • Click Browse文档图像 next to the Read from file field, and then browse to and select the file A.csv.

      • 单击字段右侧的“加号”文档图像 ,然后选择“ExcelB” > “在 Excel 中指定” 。电子表格随即在 Excel 中打开。由于文件中已有数据,并且我们要保留这些数据,因此请选择第一个空行(单元格A7 )中的第一个单元格,然后单击“确认” 。该字段将更新为您选择的“[ExcelB] Sheet1!A7” 。

        您已指明要从 A7 单元格开始将数据从 CSV 文件 A.csv 复制到 Sheet1 中的 ExcelB 文件。

  4. 步骤 4:将 Outlook 帐户添加到项目中并发送电子邮件。

    A.csv 中的数据被复制到 B.xlsx,然后附加到邮件消息中,并使用“发送电子邮件”活动中配置的详细信息发送。

    1. 在活动面板中,选择“邮件”选项卡,然后将“使用桌面 Outlook App”活动拖放到“使用 Excel 文件”活动下方。“使用桌面 Outlook App”活动随即添加到“设计器”面板中。

    2. 在活动中,“帐户”字段中已经选择默认的电子邮件帐户。如果您要使用其他帐户,请从下拉菜单中选择。

      在“引用为”字段中,保留默认值 Outlook 作为在自动化中引用该帐户时使用的名称。

    3. 在“活动”面板中,将“发送电子邮件”活动拖放到“使用桌面 Outlook App”活动中。

    4. 在"发送电子邮件"活动中:

      • Click Plus文档图像 on the right side of the From account field, and then select Outlook.

      • Click Plus文档图像 on the right side of the To field, and then select Text. In the Text Builder window, enter an email address where to send the email. For example, you can enter your own email address to send the email to yourself. If you leave the Is draft option selected, the automation does not send the email, it instead saves the email to the Outlook Drafts folder.

      • Click Plus文档图像 on the right side of the Subject field, and then select Text. In the Text Builder window, enter a subject for the email, for example Updated Excel File.

      • Click Plus文档图像 on the right side of the Body field, and then select Text. In the Text Builder window, enter text for the body of the email, for example See attachment.

      • 对于附件,选择“文件”,然后单击字段旁边的“浏览”文档图像,然后浏览至文件“B.xlsx”并选中。

    5. 在 StudioX 功能区中单击“保存”,以保存自动化,然后单击“运行”来执行此自动化。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新