- リリース ノート
- 基本情報
- チュートリアル
- オートメーション プロジェクト
- オートメーションの作成
- オートメーションの基礎情報
- オートメーションのベスト プラクティス
- チュートリアル: CSV から Excel にコピーし、ファイルをメールで送信する
- PowerPoint の自動化
- 共通アクティビティ
このチュートリアルでは、CSV ファイルから既存の Excel ファイルにデータをコピーし、その Excel ファイルをメールに添付して Outlook からメールを送信します。
プロジェクトを作成したら、まずはデータをコピーする Excel ファイルを指定する [ Excel ファイルを使用 ] アクティビティを追加します。このアクティビティ内に [ CSV を読み込み ] アクティビティを追加して、コピー元の CSV ファイルと、Excel ファイル内のコピー先を指定します。次に、[ デスクトップ版 Outlook アプリを使用 ] アクティビティを追加して使用する Outlook アカウントを指定し、その中にメールを送信するための [メールを送信 ] アクティビティを追加します。
-
手順 1: プロジェクトを設定し、必要なファイルを取得する
- Create a new blank project using the default settings.
- この例では、このページ下部にあるボタンを使用して、オートメーション プロジェクトを含むアーカイブをダウンロードして展開し、A.csv ファイルと B.xlsx ファイルをプロジェクト フォルダーにコピーします。
-
手順 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. -
[CSV を読み込み] アクティビティで、以下の手順を実行します。
-
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.これで、CSV ファイル A.csv から、ファイル ExcelB の Sheet1 セル A7 を先頭にデータをコピーするよう指定したことになります。
-
-
-
手順 4: Outlook アカウントをプロジェクトに追加して、メールを送信する
A.csv のデータが B.xlsx にコピーされ、次にメール メッセージに添付され、[メールを送信] アクティビティに設定されている詳細を使用して送信されます。
-
[アクティビティ] パネルで [メール] タブを選択し、[デスクトップ版 Outlook アプリを使用] アクティビティをドラッグして [Excel ファイルを使用] アクティビティの下にドロップします。[デスクトップ版 Outlook アプリを使用] アクティビティがデザイナー パネルに追加されます。
-
このアクティビティの [アカウント] フィールドには、あらかじめ既定のメール アカウントが入力されています。別のアカウントを使用する場合は、ドロップダウン メニューから選択します。
[参照名] フィールドは既定値
Outlookのままとして、オートメーションでアカウントを参照するときは、この名前を使用します。 -
[アクティビティ] パネルで [メールを送信] アクティビティをドラッグし、[デスクトップ版 Outlook アプリを使用] アクティビティ内にドロップします。
-
[メールを送信] アクティビティで、以下の手順を実行します。
-
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. -
[添付ファイル] を指定するには、[ファイル] を選択して、フィールドの横の [参照]
アイコンをクリックします。つづいて、ファイル reconcile-[Excel] Date!YYYYMMDD.csv を参照して選択します。
-
-
StudioX のリボンで [保存] をクリックしてオートメーションを保存し、[実行] をクリックしてオートメーションを実行します。
-