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

StudioX user guide

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

教程:遍历 Outlook 邮件并保存附件

在本教程中,我们将创建一个自动化项目,实现将 Outlook 搜索文件夹中所有电子邮件的附件保存到计算机中。

We will create a project and start by adding a Use Desktop Outlook App activity to indicate the Outlook account to use. In this activity, we will add a For Each Email activity to indicate that we want to iterate through the emails in a folder. We will then add the activities to repeat inside For Each Email.

  1. 在计算机上创建一个 Temp 文件夹,在 Outlook 中创建一个搜索文件夹。

    1. 在计算机 C 盘的根目录中创建一个名为“Temp”的文件夹。
    2. 打开 Outlook,然后右键单击“文件夹”窗格中的“搜索文件夹”,然后选择“新建搜索文件夹”
    3. 在“新建搜索文件夹”窗口中,选择“创建自定义搜索文件夹” > “选择”
    4. 在“自定义搜索文件夹”窗口的“名称”框中输入“上周的附件”,然后选择“条件”
    5. 在“搜索文件夹条件”窗口的“消息”选项卡中,从“时间”旁边的下拉菜单中选择“已接收”和“上周”
    6. 在“更多选择”选项卡中选择“仅项目”,然后从相邻的下拉菜单中选择一个或多个附件。
    7. 单击“确定”三次以关闭窗口并保存搜索文件夹。
  2. 设置项目。

  3. 将 Outlook 帐户添加到项目中。

    1. 在“活动”面板中,选择“邮件”选项卡,然后双击“使用桌面 Outlook App”。该活动随即添加到“设计器”面板中。

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

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

  4. 遍历 Outlook 文件夹中的消息。

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

    2. In the For Each Email activity, click Plus 文档图像 on the right side of the In emails from field, and then select Outlook > [Search Folders] > [Last week's attachments] to select the search folder created in the account Outlook. Your selection is displayed in the In emails from field as Last week's attachments.

      您已指明要遍历 Outlook 搜索文件夹“Last week's attachments”中的电子邮件。

      文档图像

  5. 将每条消息的附件保存到计算机上的文件夹中。

    1. In the Activities panel, drag the Save Email Attachments activity and drop it inside the For Each Email activity.

    2. 在“保存电子邮件附件”活动中:

      • Click Plus 文档图像 on the right side of the Email field, and then select CurrentMail to indicate that the email whose attachments you want to save is the current email you are iterating through.

      • Click Browse 文档图像 next to the Save to folder field, and then browse to and select the folder on your computer where to save the attachments. For this example, we created a folder called Temp on the C drive of the computer.

        文档图像

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

      The attachments from each email in the Outlook folder Temp are saved to the Temp folder on the computer.Download example

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新