- 基本情報
- チュートリアル
- オートメーション プロジェクト
- オートメーションの作成
- トラブルシューティング
StudioX user guide
このチュートリアルでは、チームの各メンバーに対する個人別実績レビューを Word 文書として生成するオートメーション プロジェクトを作成します。この Word 文書は、テンプレートの Word ファイルと、複数の Excel およびテキスト ファイルから収集したデータに基づいて生成します。テンプレート ファイルには Word アクティビティを使用して値を入力することのできる、プレースホルダーのテキストとブックマークが設定されています。データのコピー元となる Excel とテキスト ファイルの名前は、従業員名を含む特定のパターンに従っているものとします。
We will start by adding a Use Excel File activity to indicate an Excel file with employee information to add to the automation. Inside it, we will add a For Each Excel Row activity to iterate through the rows with employee data. Inside For Each Excel Row, we will add a Use Word File activity to add the template document to the automation, and then a series of Replace Text, Set Bookmark Content, and Insert DataTable in Document activities will populate each Word file with the necessary information taken for each employee from an Excel file and a text file. Finally, we will add a Save Word File As activity to save the template document as a separate file for each employee.
- プロジェクトを設定し、必要なファイルを取得します。
- Create a new blank project using the default settings.
- このチュートリアルでは、このページ下部にあるボタンを使用して、オートメーション プロジェクトを収めたアーカイブをダウンロードして展開します。プロジェクト フォルダーに Files フォルダーをコピーします。
- プロジェクト フォルダーに Output という名前のフォルダーを作成します。
- 従業員データを含む Excel ファイルをプロジェクトに追加し、ファイル内の行を反復処理する
- In StudioX, 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. The activity is added to the Designer panel. - アクティビティで次の操作を行います。
-
Click Browse
next to the Excel file field, and then browse to the Files folder and select the file Employees.xlsx. -
[参照名] フィールドに「
EmployeeData」と入力します。これで、このオートメーションでは名前を EmployeeData としたファイル Employees.xlsx を操作対象として指定したことになります。
-
- Click Add Activity
inside Use Excel File, and then find the For Each Excel Row activity in the search box at the top of the screen and select it. The activity is added to the Designer panel inside the Use Excel File activity. - [繰り返し (Excel の各行)] アクティビティで、次の操作を行います。
-
[繰り返し] テキスト ボックスの
CurrentRowをEmployeeに置換します。 -
Click Plus
on the right side of the In range field, and then select EmployeeData > Sheet1 [Sheet].これで、Employees スプレッドシートの Sheet1 の行に対して反復処理を実行するように指定したことになります。各行には 1 名の従業員に関する情報が含まれているため、反復処理の現在の行の名前を Employee に変更しました。これは、オートメーション プロジで行に含まれる情報を識別しやすくするためです。

-
- In StudioX, click Add Activity
- テンプレートの Word ファイルをオートメーション プロジェクトに追加します。
- Click Add Activity
inside For Each Excel Row, and then find the Use Word File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [Word ファイルを使用] アクティビティで、次の操作を行います。
-
Click Browse
next to the Word file field, and then browse to the Files folder and select the file PerformanceReviewDoc_template.docx. -
Clear the Save changes check box. This ensures that the template file is not saved with the data added for each employee.
ここでは、PerformanceReviewDoc_template.docx というファイルを使用して作業するように指定しました。

-
- Click Add Activity
- 従業員データを含む Excel ファイルから Word ファイルに情報を追加します。
- Click Add Activity
inside Use Word File, and then find the Replace Text activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [テキストを置換] アクティビティで、次の操作を行います。
-
Click Plus
on the right side of the Search for field, and then select Text. In the Text Builder, enter <>. -
Click Plus
on the right side of the Replace with field, and then select Employee > Full Name.You have indicated that you want to replace the placeholder text <
> in the Word file with the full name that is copied for each employee from the cell in the Full Name column of the Employees Excel file.
-
- Click Add Activity
below the Replace Text activity, and then find the Set Bookmark Content activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [ブックマークのコンテンツを設定] アクティビティで、次の操作を行います。
-
Click Plus
on the right side of the Bookmark name field, and then select Text. In the Text Builder, enter DirectManager. -
Click Plus
on the right side of the Bookmark text field, and then select Employee > Direct Manager.ここでは、各従業員について、Excel ファイル Employees (従業員) の Direct Manager (課長) 列のセルの内容をコピーし、Word ファイルのブックマーク DirectManager (課長) の場所に貼り付けることで、Word ファイルに直属の上司の名前を追加するように指定しました。
-
- ステップ 3 ~ 4 を 3 回繰り返し、各従業員の Full Name (フル ネーム)、Location (勤務地)、Title (役職) を Word ファイルに追加する [ブックマークのコンテンツを設定] アクティビティを追加します。各アクティビティを次のように設定します。
-
[ブックマーク名]
FullName、[ブックマーク テキスト] Employee > Full Name -
[ブックマーク名]
Location、[ブックマーク テキスト] Employee > Location -
[ブックマーク名]
PositionTitle、[ブックマーク テキスト] Employee > Position Title
-
- Click Add Activity
- プロジェクトに関するデータを含む Excel ファイルから Word ファイルに情報を追加します。
- Click Add Activity
below the last Set Bookmark Content, and then find the Use Excel File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [Excel ファイルを使用] アクティビティで次の操作を行います。
-
Click Plus
on the right side of the Excel file field, and then select Text.テキスト ビルダーで
-
「
Files\」と入力します。 -
Click Plus
on the right side of the Text Builder, and then select Employee > Full Name. -
「
_Projects.xlsx」と入力します。テキストは「
Files\[Employee]FullName_Projects.xlsx」のようになります。 -
テキスト ビルダーで [保存] をクリックします。
ここでは、従業員ごとにプロジェクトの Excel ファイルをオートメーション プロジェクトに追加するように指定しました。Excel ファイルの選択では動的なファイル パスを使用し、プロジェクト ファイルを使用するアクティビティでデータを選択できるように、ファイルの 1 つをテンプレート ファイルとして指定しました。
-
-
- Click Add Activity
inside the newly added Use Excel File activity, and then find the Insert DataTable in Document activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [ドキュメントにデータテーブルを挿入] アクティビティで、次の操作を行います。
-
Click Plus
on the right side of the Table to insert field, and then select Projects > Sheet1 [Sheet] > Table1 [Table]. -
[次を基準にして挿入] ドロップダウン メニューから [ブックマーク] を選択します。
-
Click Plus
on the right side of the Bookmark to search for field, and then select Text. In the Text Builder, enter Projects. -
[挿入位置] ドロップダウン メニューから [後] を選択します。
これで、各従業員について、Projects Excel ファイルから Table1 をコピーし、Word ファイルの Projects という名前のブックマークの後に貼り付けるように指定したことになります。

-
- Click Add Activity
- 上司からのフィードバックを含むテキスト ファイルから Word ファイルに情報を追加し、従業員ごとに別のファイルに保存します。
- Click Add Activity
below the newly added Use Excel File activity, and then find the Read Text File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [テキスト ファイルを読み込み] アクティビティで、次の操作を行います。
-
Click Plus
on the right side of the Filename field, and then select Text.テキスト ビルダーで
-
「
Files\」と入力します。 -
Click Plus
on the right side of the Text Builder, and then select Employee > Full Name. -
「
_ManagerFeedback.txt」と入力します。テキストは「
Files\[Employee]FullName_ManagerFeedback.txt」のようになります。 -
テキスト ビルダーで [保存] をクリックします。
-
-
In the Properties panel, click Plus
on the right side of the Output to field, and then select Open in Advanced Editor. Enter the expression Saved.Values(Of String)("ManagerFeedback")and click OK.ここでは、各従業員について、ファイル名に従業員名を含むテキスト ファイルから上司のフィードバックをコピーし、後からオートメーション プロジで使用するために保存するように指定しました。
-
- Click Add Activity
below the Read Text File activity, and then find the Set Bookmark Content activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [ブックマークのコンテンツを設定] アクティビティで、次の操作を行います。
-
Click Plus
on the right side of the Bookmark name field, and then select Text. In the Text Builder, enter DirectManagerFeedback. -
Click Plus
on the right side of the Bookmark text field, and then select Use Saved Value > ManagerFeedback.ここでは、各従業員について、後で使用するために [テキスト ファイルを読み込み] アクティビティで保存しておいた上司のフィードバックをコピーし、Word ファイルのブックマーク DirectManagerFeedback の場所に貼り付けるように指定しました。

-
- Click Add Activity
below the Set Bookmark Content activity, and then find the Save Word File As activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - [名前を付けて Word ファイルを保存] アクティビティで、次の操作を行います。
-
Click Plus
on the right side of the Save as file field, and then select Text.テキスト ビルダーで
-
「
Output\」と入力します。 -
Click Plus
on the right side of the Text Builder, and then select Employee > Full Name. -
「
_PerformanceReview.docx」と入力します。テキストは「
Output\[Employee]FullName_PerformanceReview.docx」のようになります。 -
テキスト ビルダーで [保存] をクリックします。
-
-
その他のオプションは、既定の選択のままにします。
ここでは、各従業員のデータに基づいて変更したテンプレート ファイルを、Output (出力) という名前の新規フォルダーに保存するように指定しました。Excel ファイル Employees (従業員) の Full Name (フル ネーム) 列の値に基づいて、各従業員のフル ネームがファイル名に追加されます。
-
- Click Save in the StudioX ribbon to save the automation, then click Run to execute the automation.The automation creates separate performance review Word documents for each employee in the Output folder and populates the files with information from the Excel files with employee data and projects information, and from the text files with manager feedback. Download example
- Click Add Activity