Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

WordTemplate can insert certain types of documents into docx files by adding the "document(format)" modifier to the merge field, where format is one of the following:

  • rtf - The binary data in the data source will be inserted as an rtf document, e.g. «Product.Doc(document(rtf))».
  • html - The binary data in the data source will be inserted as an html document, e.g. «Product.Webpage(document(html))».
  • docx (Introduced in 8.5) - The binary data in the data source will be inserted as an docx document, e.g. «Product.Doc(document(docx))»

To add the modifier:

  1. Create or open a WordWriter template (for instructions, see Creating a WordWriter Template).
  2. Add the "document(rtf)" or , "document(html)" modifier or "document(docx)" modifier in parentheses to the merge field in which you want to insert the document. For example, change «Product.Doc» to «Product.Doc(document(rtf))»

Binding the data:
The data that corresponds to the merge field with the document modifier must be a byte array.

Paragraphs

When inserting an embedded document, the document must go at the same level as the paragraphs, to align the template file with the output, document fields should be put in their own paragraph:

Will become:

...