Skip to content

Mail-Merge Title Fields

Create Title wraps each cell of a table's header row in square brackets [...], turning every column name into the mail-merge field string a Word template needs. It is the preparation step for Merge to Word — the way to issue a stack of inspection records, inspection request forms or work assignment slips from a single Excel table.

The command sits on tab DVD Addin → group File and PrintMerge Menu.

Commands in this group

CommandWhat it does
Create TitleRewrite every cell of the picked range's first row as [old value]
Merge to WordOne Word file per data row, substituting [Column name] with the cell value
Word → PDFBatch-convert the merged Word files to PDF
Rename FilesBring the output file names into your document-control convention

Preparing the merge fields

  1. Build the data table. The first row holds the column names; every row below becomes one issued document. Name the columns exactly as you want to read them in Word, punctuation and spaces included.
  2. Copy the header row to a scratch row (or a scratch sheet). That copy becomes the list of field strings you paste into Word, while the real header row of the data range keeps plain names.
  3. Run Create Title on the scratch row: Merge MenuCreate Title. Excel's range picker opens, titled DVD Addin — Create title row, asking you to select the title row to wrap with [...]. Drag over that row (for example A20:H20) and click OK; the add-in reports "Created N title fields."
  4. Paste the [...] strings into the Word template, positioned inside the sentences, tables and signature blocks where the values belong.
  5. Run Merge to Word: pick the template folder and the output folder, tick the templates to use, point Data range (with header) at the table from step 1, choose the Output filename column, then click Merge.
  6. Verify before running the full batch. Merge two or three rows first and open the Word files to check that no [Column name] was left unsubstituted.

Example

An inspection-request register with its header row at A3:E3. After copying it to a scratch row and running the command:

BeforeAfter
Form No.[Form No.]
Work package[Work package]
Activity inspected[Activity inspected]
Inspection date[Inspection date]
Location[Location]

In the template IR_Work.docx you then write:

On [Inspection date], at [Location], the parties inspected the activity [Activity inspected] under work package [Work package], request no. [Form No.].

Run Merge to Word with the data range A3:E38 and Form No. as the file-name column — 35 Word records come out, each named <template name>_<form no.>.docx, ready to print and sign.

Tips and caveats

  • Only the first row of the selection is processed. Selecting the whole table is harmless — the data rows below are untouched.
  • Do not run it on the header row of the range you will actually merge. Merge to Word builds its search string itself as [ + column header + ]; if the header already reads [Form No.], the string it hunts for in Word becomes [[Form No.]]. Keep the real header row plain and take the field strings from the scratch row.
  • Running the command twice on the same row nests the brackets into [[Column name]]; an empty header cell becomes [], so fill in every column name first.
  • The command overwrites cell values and cannot be undone with Ctrl+Z; a header cell containing a formula becomes the plain text [result] and the formula is lost. Keep a copy of important workbooks.
  • Image columns: if a cell value is a path ending in .png, .jpg, .jpeg, .bmp or .gif and the file exists, Merge to Word inserts the picture at the field position; if the file is missing, the field is simply blanked.
  • Table columns: a column name starting with Bảng, Bang, Table or tbl is treated specially — the cell value is read as a named range, looked up on the sheet called Tables first and then anywhere in the workbook, and pasted into Word as a real table.
  • A line break inside an Excel cell (Alt+Enter) is converted to a Word line break during the merge.

See also

  • Merge to Word — the next step, consuming the [...] fields you just created.
  • Send Email — bulk issuing through Outlook (it points at cells directly and does not use [...] fields).
  • Email Template — the sample workbook with the standard column layout for bulk mail.

Released under DVDAddin License.