Jetformat

Word templates, mail merge, or legacy form fields?

Choose the filling command from the structure of the Word template. Similar-looking placeholders can use three different mechanisms.

Published · 4 min read

By Jetformat

Compare the three mechanisms

Template structure Command What identifies a value
Content control word template Tag or Alias
MERGEFIELD code word mail-merge Merge field name
Legacy form field word fill-fields Legacy field name

A printed label such as “Customer” does not tell you which mechanism the author used. Inspect the template before automating a batch. Replacing visible strings blindly can change ordinary prose while leaving the actual field unresolved.

Identify the source before filling it

Run jetformat word inspect letter.docx --json to examine structure. Use jetformat word form-fields letter.docx when the document is expected to contain legacy fields. Keep a pristine template and write each result to a new path.

For a content control tagged customer, the workflow is:

jetformat word template letter.docx --set customer="Acme Corp" -o filled.docx
jetformat text filled.docx --format markdown

For a MERGEFIELD named Customer, use word mail-merge instead. Preserve field name case. A batch should record which template revision and input values produced each output, without putting private customer data into public logs.

Verify both values and layout

Extracted text helps find unresolved placeholders and incorrect values. It cannot show that a long customer name wrapped into a signature block. Convert a representative filled document to PDF, then inspect a rendered page before processing the remaining records.

Use content-control filling, mail merge, or legacy field filling for the exact command. If an output contains the right words but looks wrong, follow the font and layout checks.

Last updated