Fill Word Template
Fill Word Template
Fills a Word document used as a template, replacing placeholders (variables) with the given values and saving the result as a new file. Ideal for automatically generating contracts, reports and standardized documents.
Options
Path to the template
Enter the full path of the Word file used as the template, including the name and the .docx extension. Example: C:\Usuários\Roberty\Desktop\modeloRelatório.docx.
Path to save filled file
Enter the full path of the folder where the filled Word document will be saved. Example: C:\Usuários\Roberty\Desktop\Documentos.
Name to save the filled file
Enter the name of the file to generate, including the .docx extension. Example: relatórioPreenchido.docx.
Fill variables
Enter, as code, an object with the values that replace the template placeholders. Each object property matches a placeholder. Example:
{ nome: "Maria Silva", data: "28/10/2026" }
In the template document, placeholders are written between +++. Example: +++nome+++, +++data+++.
Returns
This action has no returns.
Rules and Conditions
- The Path to the template, Path to save filled file, Name to save the filled file and Fill variables fields are required.
- The template document must contain placeholders in the defined format for the replacement to work correctly.
- The destination directory must exist before the run.
- The template file is not modified — a new file is created at the output path.
- If a file with the same name already exists in the destination folder, the action returns an error and does not overwrite it.