- 基本情報
- チュートリアル
- オートメーション プロジェクト
- オートメーションの作成
- オートメーションの基礎情報
- オブジェクト リポジトリ
- オートメーションのベスト プラクティス
- チュートリアル: ピボット テーブルを作成する
- チュートリアル: 表の行を反復処理する
- チュートリアル: Excel ファイルを比較し、照合エラーのメールを送信する
- チュートリアル: 自動化されたメールからデータを抽出し、デスクトップ アプリケーションにデータを移動する
- チュートリアル: Excel データをフィルター処理する
- チュートリアル: セルの書式を設定する
- チュートリアル: フォルダー内のファイルに関する情報を Excel ファイルに追加する
- チュートリアル: プロジェクト ノートブックに独自の式を追加する
- PowerPoint の自動化
- データの自動化
- 共通アクティビティ
- Google Workspace の自動化
- OneDrive と SharePoint の自動化
- トラブルシューティング

StudioX user guide
チュートリアル: 自動化されたメールからデータを抽出し、デスクトップ アプリケーションにデータを移動する
このチュートリアルでは、特定のデータを特定の書式設定に準拠したテキスト ブロックから容易に抽出できるようにするオートメーションを作成します。銀行勤務で、新しい入金取引に関連する多数のメール通知を受信しているとします。各メールを開き、手動で金額をコピーしてテラー アプリケーションに貼り付け、処理済みの各メールを Outlook フォルダーに移動する必要があります。メールは自動化され、すべて同じテンプレートに準拠し、同じテキストがメール本文の必要な金額の隣に常に表示されます。例:
!!!This is an automated message, please do not respond.
A new deposit transaction can be submitted:
Cash in: $10
On Us Check: $20
Not On Us Check: $15
Thank you.
!!!This is an automated message, please do not respond.
A new deposit transaction can be submitted:
Cash in: $10
On Us Check: $20
Not On Us Check: $15
Thank you.
The default Project Notebook contains formulas that can extract only the needed amounts. We will manually edit the Project Notebook to extract the values from one email, as described in Step 2: Set up a project and get the necessary files , and then configure our automation to extract the same values from all similar emails.
オートメーションにより、入金取引に関連する自動化された最新の未読メールを格納する Outlook 検索フォルダー内の各メールについて、次のタスクが実行されます。
- メールの本文がコピーされ、データがプロジェクト ノートブックに貼り付けられます。ここで、テキストを操作するために Excel の数式を使用して特定のデータが抽出されます。
- デスクトップ アプリケーションでデータがフィールドごとに入力され、送信されます。
- メールが既読になり、処理済みメール用の Outlook フォルダーに移されます。
We will create a project and start by adding a Use Desktop Outlook App activity to indicate the Outlook account to use. We will then add a For Each Email activity, and then, to indicate the automation must be executed for each email, we will place all subsequent activities inside For Each Email. We will add a Write Cell activity to copy the body of each email to a specific cell in the Project Notebook. We will then add the UI automation activities needed to enter the data in our desktop application, and finally activities to mark the email as read and move the email .
-
Outlook にフォルダーを 2 つ作成する
この例では、件名が
New Deposit Availableで前述の本文を持つメールを使用します。指定の件名を持つ、本日以降の未読メール用の検索フォルダーを作成するには、次の操作を行います。
- Outlook を開き、[フォルダー] ペインで [検索フォルダー] を右クリックし、[新しい検索フォルダー] を選択します。
- [新しい検索フォルダー] ウィンドウで、[カスタム検索フォルダーを作成する] > [選択] を選択します。
- [検索フォルダーのカスタマイズ] ウィンドウの [名前] ボックスに
Today's depositsを入力し、[条件] を選択します。 - [検索フォルダーの条件] ウィンドウの [メッセージ] タブで、以下の手順を実行します。
- [時間の条件] の隣にあるドロップダウン メニューから、[受信日時] と [今日] を選択します。
- [検索する文字列] ボックスに、「New Deposit Available」と入力します。
- [検索対象] ドロップダウン メニューから、[件名] を選択します。
- [詳細設定] タブで、[開封状況] を選択し、隣接するドロップダウン メニューから [未読] を選択します。
- [OK] を 3 回クリックして、ウィンドウを選択し、フォルダーを保存します。
- 受信ボックスに ProcessedDeposits というフォルダーを作成します。これは、処理後にメールが移されるフォルダーです。
- 特定の件名と特定のテンプレートに準拠した本文を利用するオートメーションで使用するメール アカウントに、メールを 2、3 通送信します。ただし、各メールには異なる金額を入力します。
- 送信後、
Today's deposits検索フォルダーに該当のメールが表示されることを確認します。
-
プロジェクトを設定し、必要なファイルを取得します。
-
該当のプロジェクトのプロジェクト ノートブックを開き、メールの本文を Text シートのセル B4 にコピーし、セル D5:D7 の 3 つの値それぞれの左側にテキストを手動で入力します。セル D5 には
Cash in:、セル D6 にはOn Us Check:、セル D7 にはNot On Us Check:を入力します。値の右側にはテキストは存在しないため、セル E5:E7 は空になるはずです。セル F5:F7 に既に入っている数式は、下図のように、値を抽出します。
プロジェクト ノートブックを保存して閉じます。
-
このチュートリアルでは、このページの下部にあるボタンを使用して、オートメーション プロジェクトを含むアーカイブをダウンロードして展開します。ファイル DoubleUI.exe をダブルクリックし、DoubleUI アプリケーションを開きます。
-
Outlook アカウントをプロジェクトに追加し、検索フォルダーでメッセージを反復処理する
-
[アクティビティ] パネルで [メール] タブを選択し、[デスクトップ版 Outlook アプリを使用] をダブルクリックします。アクティビティがデザイナー パネルに追加されます。
-
このアクティビティの [アカウント] フィールドには、あらかじめ既定のメール アカウントが入力されています。別のアカウントを使用する場合は、ドロップダウン メニューから選択します。
[参照名] フィールドは既定値
Outlookのままとして、オートメーションでアカウントを参照するときは、この名前を使用します。 -
[アクティビティ] パネルで [繰り返し (各メール)] アクティビティをドラッグし、[デスクトップ版 Outlook アプリを使用] アクティビティ内にドロップします。
-
In the For Each Email activity, click Plus
on the right side of the In emails from field, and then select Outlook > [Search Folders] > [Today's deposits].これで、Outlook 検索フォルダー「Today's deposits (今日の預金)」内のメールに対して反復処理を実行するように指定したことになります。

-
-
メール本文をプロジェクト ノートブックのセルにコピーし、テキストを抽出する
- [アクティビティ] パネルで [Excel] タブを選択し、[Excel ファイルを使用] アクティビティをドラッグして [繰り返し (フォルダー内の各ファイル)] アクティビティ内にドロップします。
- [Excel ファイル] フィールドで、Excel ファイル「Project_Notebook.xlsx」を参照します。
- [Excel ファイルを使用] アクティビティ内に [セルに書き込み] アクティビティを追加します。
- [セルに書き込み] アクティビティで、以下の手順を実行します。
-
Click Plus
on the right side of the What to write field and then select CurrentMail > Body to indicate that you want to copy the body of the current mail in the iteration. -
Click Plus
on the right side of the Where to write field, and then select Notebook > Indicate in Excel to open the file in Excel. In the file, select the Text sheet, and then the B4 cell, and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to paste the email body to cell B4 in the Text sheet of the Project Notebook.
-
-
デスクトップ アプリケーションとアプリケーション内で実行するアクティビティを追加する
-
[アクティビティ] パネルで [アプリ/Web] タブを選択し、[アプリケーション/ブラウザーを使用] アクティビティをドラッグして、[セルに書き込み] アクティビティの下にある [繰り返し (各メール)] アクティビティ内にドロップします。[アプリケーション/ブラウザーを使用] アクティビティがデザイナー パネルに追加されます。
-
[アプリケーション/ブラウザーを使用] アクティビティで、[アプリケーションを指定] をクリックして、マウス ポインターを DoubleUI アプリケーションの上に移動します。ウィンドウが強調表示されるので、DoubleUI の任意の場所をクリックします。
[アプリケーション/ブラウザーを使用] アクティビティが更新され、ウィンドウのスクリーンショットがアクティビティに表示されます。
-
In the Activities panel, select the App/Web tab, and then drag a Type Into activity and drop it inside the Use Application/Browser activity. A Type Into activity is added in the Use Application/Browser activity.
-
[文字を入力] アクティビティで次の操作を行います。
-
[画面上でターゲットを指定] をクリックし、DoubleUI.exe アプリケーションの [Cash In] フィールドにマウス ポインターを移動します。フィールドが強調表示されたらクリックします。テキスト フィールドがターゲットとして、フィールドの横の [Cash In] ラベルがアンカーとして識別されます。[選択オプション] ウィンドウの [確認] をクリックして選択内容を保存します。ターゲットとアンカーの画像が [文字を入力] アクティビティに表示されます。
これで、DoubleUI.exe アプリケーションの [Cash In] フィールドに文字を入力するように指定したことになります。
-
Click Plus
on the right side of the Type this field, and then select Excel > Indicate in Excel. In the Excel file, select the F4 cell (the Cash In value) and click Confirm in the UiPath tab of the Excel ribbon. The Type this field displays your selection as [Notes] Text!F5.これで、Excel ファイルから入金の額を DoubleUI.exe アプリケーションの [Cash In] フィールドにコピーするように指定したことになります。
-
-
ステップ 3 ~ 4 を 2 回以上繰り返し、[文字を入力] アクティビティを追加し、Excel ファイル (それぞれセル F6 および F7) から [On Us Check] および [Not On Us Check] の値を DoubleUI アプリケーションの対応するフィールドにコピーします。
-
In the Activities panel, select the App/Web tab, and then drag a Click activity and drop it inside the Use Application/Browser activity after the Get Text activity. A Click activity is added in the Use Application/Browser activity.
-
[クリック] アクティビティで [画面上でターゲットを指定] をクリックし、DoubleUI.exe アプリケーションの [Accept] ボタンにマウス ポインターを移動します。ボタンが強調表示されたらクリックします。[Accept] ボタンがターゲットとして、[Cancel] ボタンがアンカーとして識別されます。[選択オプション] ウィンドウの [確認] をクリックして選択内容を保存します。ターゲットとアンカーの画像が [クリック] アクティビティに表示されます。
これで、DoubleUI.exe アプリケーションの [Accept] ボタンをクリックするように指定したことになります。

-
-
メールを既読にし、Outlook フォルダーに移動する
-
[アクティビティ] パネルで [メール] タブを選択し、[メールを既読/未読にする] アクティビティをドラッグして [アプリケーション/ブラウザーを使用] の下にある [繰り返し (各メール)] アクティビティ内にドロップします。[メールを既読/未読にする] アクティビティがデザイナー パネルに追加されます。
-
[メールを既読にする] アクティビティで、次の操作を行います。
- Click Plus
on the right side of the Email field and then select CurrentMail to indicate that you want to mark the current mail in the iteration. - [マーク] ドロップダウン メニューから [既読] を選択します。
- Click Plus
-
[アクティビティ] パネルで、[メールを移動] アクティビティを [メールを既読/未読にする] アクティビティの下にある [繰り返し (各メール)] アクティビティ内にドラッグします。[ファイルを移動] アクティビティがデザイナー パネルに追加されます。
-
[メールを移動] アクティビティで、以下の手順を実行します。
-
Click Plus
on the right side of the Email field and then select CurrentMail to indicate that you want to move the current mail in the iteration. -
Click Plus
on the right side of the Move to field, and then select Outlook > [Inbox] > [ProcessedDeposits]. You have indicated that you want to move the email to the ProcessedDeposits folder.
-
-
StudioX のリボンで [保存] をクリックしてオートメーションを保存し、[実行] をクリックしてオートメーションを実行します。
For each email in the Outlook Search Folder, the body is copied to Excel, the data is extracted and entered in the DoubleUI desktop application, the email is then marked as read and moved to a different folder.Download example
-