Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: clarifications

...

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

Except where noted in the Restrictions section, rtf fields can go anywhere that normal merge fields would go.

Paragraphs

When inserting an rtf document, the document must go at the same level as the paragraphs, this means that if the merge field is in the middle of a to align the template file with the output, rtf documents should be put in their own paragraph:

Some Text Before «Product.Doc(document(rtf))» Some text after

It will become:

Some Text Before
My sweet rtf document
has some content Some text after

As a special case, if you don't have any content on either side:

If there is content on both sides, paragraph breaks will be inserted on either side of the rtf document:

Some Text Before «Product.Doc(document(rtf))» Some text after

It will Will become:

Some Text Before
My sweet rtf document
has some content
Some text after

Having only text before or only text after, will result in a blank paragraph on the other side, such as:

...

Some Text Before
My sweet rtf document
has some content
{quote}

Formatting

Rtf documents maintain their own formatting, so if there is some bold text, or a right-aligned paragraph in the rtf document it will maintain that formatting. This includes the default font for the document, which may not match the default font of the template.

Restrictions

Because Like regular merge fields rtf fields can be in an if fields optional text to display, but, because WordTemplate does not parse the contents of the rtf document, rtf fields in the comparison portion of if fields is are not supported, when UpdateIfFields is set to true.
Because inserting an rtf document is not the same as inserting a character run some formatting and document structures do not support rtf fields:

  • Having mixed direction (left-to-right versus left-to-right) text in the paragraph containing the rtf field may, in some cases, not be allowed. This can be avoided by putting the rtf field in its own paragraph.
  • The cached The displayed output of another field cannot have rtf fields, however if it is in the field codes it will be handled like other fields.
  • Hyperlinks cannot span multiple paragraphs, and subsequently cannot have rtf documentsRtf fields cannot go in either part of a phonetic guide, because those also do not support multiple paragraphs.
  • Phonetic guides
  • Structured document tags cannot have rtf fields (these are the items created when quick parts inserted, and have the little tab, e.g. "Title").
  • Tracked changes (insertions,deletions,moves) are sometimes stored in such a way that prohibits rtf documents. Accepting or rejecting any changes that encompass rtf fields will ensure that this is not a problem.