- 发行说明
- 入门指南
- 教程
- 自动化项目
- 创建自动化
- 自动化基础知识
- 对象存储库
- 自动化最佳实践
- 教程:从 CSV 复制到 Excel 并通过电子邮件发送文件
- PowerPoint 自动化
- 数据自动化
- 常见活动
- Google Workspace 自动化
- OneDrive 和 SharePoint 自动化
- 故障排除
在本教程中,我们会将 CSV 文件中的数据复制到现有的 Excel 文件,然后将 Excel 文件附加到电子邮件并从 Outlook 发送电子邮件。
我们将创建一个项目,并首先添加一个“使用 Excel 文件”活动以指明要从中复制数据的 Excel 文件。在该活动内,我们将添加一个“读取 CSV”活动,以指明要从中复制数据的 CSV 文件以及要复制到的 Excel 文件中的位置。然后,我们将添加一个“使用桌面 Outlook 应用”活动以指明要使用的 Outlook 帐户,并在其中添加一个“发送电子邮件”活动以发送电子邮件。
-
第 1 步:设置项目并获取必要的文件。
- Create a new blank project using the default settings.
- 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:将 Excel 文件添加到项目中。
-
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. -
在活动中:
-
Click Browse
next to the Excel file field, and then browse to and select the file B.xlsx -
在“引用为”字段中,输入
ExcelB。您已指明将使用自动化中称为“ExcelB”的文件“B.xlsx”。
-
-
-
步骤 3:添加活动以将 CSV 文件中的数据复制到 Excel 文件。
-
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. -
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:将 Outlook 帐户添加到项目中并发送电子邮件。
A.csv 中的数据被复制到 B.xlsx,然后附加到邮件消息中,并使用“发送电子邮件”活动中配置的详细信息发送。
-
在活动面板中,选择“邮件”选项卡,然后将“使用桌面 Outlook App”活动拖放到“使用 Excel 文件”活动下方。“使用桌面 Outlook App”活动随即添加到“设计器”面板中。
-
在活动中,“帐户”字段中已经选择默认的电子邮件帐户。如果您要使用其他帐户,请从下拉菜单中选择。
在“引用为”字段中,保留默认值
Outlook作为在自动化中引用该帐户时使用的名称。 -
在“活动”面板中,将“发送电子邮件”活动拖放到“使用桌面 Outlook App”活动中。
-
在"发送电子邮件"活动中:
-
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”并选中。
-
-
在 StudioX 功能区中单击“保存”,以保存自动化,然后单击“运行”来执行此自动化。
-