- 基本情報
- チュートリアル
- オートメーション プロジェクト
- オートメーションの作成
- トラブルシューティング
StudioX user guide
このチュートリアルでは、Outlook 検索フォルダーのすべてのメールの添付ファイルをユーザーのコンピューターに保存し、それらをコンピューターの別のフォルダーに移動して、ファイル名に当日の日付を追加することによって名前を変更するオートメーションを作成します。ファイルの名前を変更するために、StudioX に用意されている既定のプロジェクト ノートブックで式を使用します。
We will create a project and start by adding a Use Desktop Outlook App activity to indicate the Outlook account to use. Inside this activity, we will add a For Each Email activity and then the common scenario Iterate through mail attachments to indicate that we want to save the attachments for each email and then process each file after it is saved. Iterating through each file in the folder where the attachments are saved, we will then add a Write Cell activity to copy the file name and edit the name in the Project Notebook, and a Move File activity to move the file with the updated name to another folder.
-
コンピューターと Outlook の検索フォルダーに 2 つのフォルダーを作成する
- コンピューターの C: ドライブのルートに In と Out という名前の 2 つのフォルダーを作成します。
- Outlook を開き、[フォルダー] ペインで [検索フォルダー] を右クリックし、[新しい検索フォルダー] を選択します。
- [新しい検索フォルダー] ウィンドウで、[カスタム検索フォルダーを作成する] > [選択] を選択します。
- [検索フォルダーのカスタマイズ] ウィンドウで、[名前] ボックスに「Last week's attachments」と入力し、[条件] を選択します。
- [検索フォルダーの条件] ウィンドウの [メッセージ] タブで、[時間の条件] の横にあるドロップダウン メニューから [受信日時] と [先週] を選択します。
- [詳細設定] タブで、[添付ファイル] を選択し、隣接するドロップダウン メニューから 1 つ以上の添付ファイルを選択します。
- [OK] を 3 回クリックしてウィンドウを閉じて、検索フォルダーを保存します。
-
プロジェクトを設定します。
-
Outlook アカウントをプロジェクトに追加する
-
[アクティビティ] パネルで [メール] タブを選択し、[デスクトップ版 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] > [Last week's attachments]. Your selection is displayed in the field as Last week's attachments.これで、Outlook の Last week's attachments フォルダーのメールを反復処理するように指定したことになります。

-
-
メールの添付ファイルを反復処理する
-
Click Add activity
inside the For Each Email activity and then, in the search box at the top of the screen, select the common scenario Iterate through mail attachments. -
In フォルダーを参照して選択し、[OK] をクリックします。
次の 2 つのアクティビティがプロジェクトに追加されます。
-
Save Email Attachments with
CurrentMailselected for the Email field, indicating that the attachments from the current mail in the iteration should be saved to the In folder that is indicated by theC:\Inselected in the Save to folder field. -
[繰り返し (フォルダー内の各ファイル)] では、[フォルダー] フィールドで
C:\Inが選択されており、このフォルダーにあるファイルを反復処理することを示しています。[開始] をクリックすると、オートメーションがすぐに実行され、メールの添付ファイルがダウンロードされて In フォルダーに保存されます。

-
-
-
メールの添付ファイルの名前を変更して別のフォルダーに移動する
-
[アクティビティ] パネルで [Excel] タブを選択し、[Excel ファイルを使用] アクティビティをドラッグして [繰り返し (フォルダー内の各ファイル)] アクティビティ内にドロップします。
-
Add a Write Cell activity inside the Use Excel File activity.
-
[セルに書き込み] アクティビティで、以下の手順を実行します。
- Click Plus
on the right side of the What to write field and then select CurrentFile > Full Name (includes full path) to indicate that we want to copy the full path of the current file in the iteration. - Click Plus
on the right side of the Where to write field and then select Notebook > File [Sheet] > FullFileName [Cell] to indicate that we want to paste the full path of the current file in the iteration to the FullFileName named cell in the File sheet of the Project Notebook.
- Click Plus
-
Click Notebook in the StudioX ribbon. In the Project_Notebook.xslx file, go to the File sheet, update the value in the named cell
ReformattedFileName(B14) to the following:=FileNameNoExtension & "-" & YYYYMMDD & "." & FileExtensionand save the file. This formula adds the current date at the end of the file name. -
[アクティビティ] パネルで [ファイル] タブを選択し、[ファイルを移動] アクティビティをドラッグして、[繰り返し (フォルダー内の各ファイル)] アクティビティ内の [セルに書き込み] アクティビティの後にドロップします。
-
[ファイルを移動] アクティビティで、次の手順を実行します。
- Click Plus
on the right side of the From field and then select CurrentFile > Full Name (includes full path) to indicate the full path of the current file in the iteration. - Click Plus
on the right side of the To field and then select Text. In the Text Builder, enter C:\Out\and then click Plus
on the right side of the window and select Notebook > File [Sheet] > ReformattedFileName [Cell]. The path in the Text Builder should look like this: C:\Out\[Notes] File!ReformattedFileName. - [上書き] オプションが選択されていることを確認してください。
- Click Plus
-
テキスト ビルダーで [保存] をクリックします。

-
StudioX のリボンで [保存] をクリックしてオートメーションを保存し、[実行] をクリックしてオートメーションを実行します。
The attachments from each email in the Outlook Search Folder are saved to the In folder on the computer, then today's date is added to the name and they are moved to the Out folder.Download example
-