- 基本情報
- チュートリアル
- オートメーション プロジェクト
- オートメーションの作成
- オートメーションの基礎情報
- オブジェクト リポジトリ
- オートメーションのベスト プラクティス
- チュートリアル: CSV から Excel にコピーし、ファイルをメールで送信する
- PowerPoint の自動化
- データの自動化
- 共通アクティビティ
- Google Workspace の自動化
- OneDrive と SharePoint の自動化
- トラブルシューティング
StudioX ユーザー ガイド
このチュートリアルでは、CSV ファイルから既存の Excel ファイルにデータをコピーし、その Excel ファイルをメールに添付して Outlook からメールを送信します。
プロジェクトを作成したら、まずはデータをコピーする Excel ファイルを指定する [ Excel ファイルを使用 ] アクティビティを追加します。このアクティビティ内に [ CSV を読み込み ] アクティビティを追加して、コピー元の CSV ファイルと、Excel ファイル内のコピー先を指定します。次に、[ デスクトップ版 Outlook アプリを使用 ] アクティビティを追加して使用する Outlook アカウントを指定し、その中にメールを送信するための [メールを送信 ] アクティビティを追加します。
- プロジェクトを設定し、必要なファイルを取得します。
- 既定の設定を使用して新しい空のプロジェクトを作成します。
- この例では、このページ下部にあるボタンを使用して、オートメーション プロジェクトを含むアーカイブをダウンロードして展開し、A.csv ファイルと B.xlsx ファイルをプロジェクト フォルダーにコピーします。
- 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 を操作対象として指定したことになります。
-
- Click Add Activity
- アクティビティを追加し、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. - [CSV を読み込み] アクティビティで、以下の手順を実行します。
-
Click Browse
next to the Read from file field, and then browse to and select the file A.csv. -
Click Plus
on the right side of the Output to field, and then select ExcelB > Indicate in Excel. The spreadsheet is opened in Excel. Because there is already data in the file and we want to keep it, select the first cell in the first empty row (cell A7), and then click Confirm. The field is updated with your selection [ExcelB] Sheet1!A7.これで、CSV ファイル A.csv から、ファイル ExcelB の Sheet1 セル A7 を先頭にデータをコピーするよう指定したことになります。
-
- Click Add Activity
- Outlook アカウントをプロジェクトに追加して、メールを送信する
-
[アクティビティ] パネルで [メール] タブを選択し、[デスクトップ版 Outlook アプリを使用] アクティビティをドラッグして [Excel ファイルを使用] アクティビティの下にドロップします。[デスクトップ版 Outlook アプリを使用] アクティビティがデザイナー パネルに追加されます。
-
このアクティビティの [アカウント] フィールドには、あらかじめ既定のメール アカウントが入力されています。別のアカウントを使用する場合は、ドロップダウン メニューから選択します。
[参照名] フィールドは既定値
Outlookのままとして、オートメーションでアカウントを参照するときは、この名前を使用します。 -
[アクティビティ] パネルで [メールを送信] アクティビティをドラッグし、[デスクトップ版 Outlook アプリを使用] アクティビティ内にドロップします。
-
[メールを送信] アクティビティで、以下の手順を実行します。
-
Click Plus
on the right side of the 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 Save as 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. -
For Attachments, select Files, then click Browse
next to the field, and then browse to and select the file B.xlsx.
-
-
StudioX のリボンで [ 保存 ] をクリックしてオートメーションを保存し、[ 実行 ] をクリックしてオートメーションを実行します。A.csv のデータは B.xlsx にコピーされてメール メッセージに添付され、[メールを送信] アクティビティで設定した詳細を使用して送信されます。サンプルをダウンロード
-