Skip to main content

Clean Templates - For Java Engine


Clean templates provides a batch tool to clean a group of templates.


This will update all tags to the mode desired, adjust selects to match the new auto-detect of select/value/evaluate, and remove the quotes on '${var}' if you have switched to set parameter (suggested).

The template file(s) is a path where the filename component can have wildcards. So it can be c:\templates\*.rtf. The output directory is the directory to place the cleaned templates in. It can be the same directory only if the file extension is changing, i.e. you cannot overwrite the template with a cleaned template.

If you do not list a data source the selects against that data source will not be changed. 


Always make a back up copy of your templates before using this tool. 


usage [options] template_file(s) output_directory.

Options are:

  -ps Substitution parameter mode.

  -pp Parameter Plus parameter mode. This is the default.

  -po Parameter Only parameter mode.

  -sq Smart quote OFF - remove quotes around ${vars}. The default is ON. Must be before -sql/xml.

  -ru Remove Unused styles, etc. OFF. The default is ON.

  -tt Text tags.

  -tf Field tags (macro in Excel).

  -tp Field Plus tags (macro in Excel). This is the default.

  -tc Content Control tags (macro in Excel).

  -v9 Use this option if the template you are cleaning was created in version 9 or earlier of AutoTag. Do not use this option if the template was created in version 10 or later. Setting/not setting this parameter correctly is very important. (What this does is tell clean template if the tags use select/evaluate/value (version 9 and earlier) or the tags use select only (version 10 and later.)

Data sources are:




From the Commandline

Here's and example of what you might type to make a djustments from the commandline: 
CleanTemplate.exe -ps -pp -po c:\full\path\to\template.docx c:\full\path\to\template1.docx c:\full\path\to\template2.docx c:\outputDir

  • Was this article helpful?