To use the Generate Document action, you first need to create a properly formatted Word template file. In the template, placeholders must be set up to receive data. These placeholders will be bound to variables within the workflow, enabling automatic filling of actual content when the document is generated. The steps are as follows:
Open Word Developer Tools
Open a Word document and click on the File menu
In the File Options window, select Options.
Go to the Customize Ribbon tab, check the Developer checkbox, and click OK to save the settings.
Insert Placeholders in the Word Document
After completing the above steps, the Developer option will be added to the toolbar. You can then insert placeholders in the required positions of the document and select the appropriate placeholder type based on the content type:
Single line Text Placeholder:
For single line text, click Text Content Control in the Developer tab to insert a text placeholder.
Select the placeholder, go to Properties.
In the popup window, enter the placeholder name in the Title and Tag fields to associate it with the corresponding variable in the workflow designer.
Rich Text Placeholder: For multi-paragraph or formatted text, select Rich Text Content Control to insert a rich text placeholder, and set a title and tag in Properties.
Picture Placeholder:
For images, choose Picture Content Control at the intended image location to insert a picture placeholder, and set a title and tag in Properties.
Table Placeholder:
Insert a Table:
Set Table Properties:
Set Placeholders for Rows:
Insert Content Controls for Columns:
Set Properties for Each Placeholder:
After inserting a placeholder in each column, click on the placeholder and open its Properties.
Fill in the Title and Tag fields (e.g., the field name such as "Name" or "Quantity"), and click OK to save.
After completing these configurations, the Word template will be ready to bind with workflow variables, ensuring correct content is populated in the Generate Document action.