When including part (or all) of one document into another, which is the basis of the BaseTemplate
, IncludeTemplate
and InsertTemplate
commands, there is always an issue about what formatting (styles, fonts, etc.) should be applied in the resulting document.
XpressDox provides three options for this, namely Source, Paragraph and Destination, and a fourth option, viz. Text being added with Version 4 of XpressDox. These are shorthand (to reduce the amount of typing required in Fillpoints) for Apply Source Document Formatting, Apply Destination Paragraph Formatting and Apply Destination Document Formatting respectively. The relevant code is placed after the template name in the IncludeTemplate
or BaseTemplate
command, for example:
«IncludeTemplate(DirectorsNames,Paragraph)»
«IncludeTemplate(InterviewLayout,Text)»
«BaseTemplate(LetterHead,Destination)»
The options are described below:
Source
What happens is that all the styles, fonts, etc. in the included Source document are copied and renamed into the Destination document, and the text, tables, lists, etc. all retain the same format as they had in the original source document. The rest of the text in the destination document remains unaltered.
With Version 4 of XpressDox, the above is not strictly correct. With Version 4 the source style is copied into the destination template without renaming, and will replace a same-named style which already appears in the destination. This means that any and all paragraphs in the destination which were formatted according to that style will be reformatted according to the style in the source template. As with Destination formatting (below) careful organization of styles will result in a powerful combination. Please see a fuller explanation in the article Source and Destination formatting in Version 4.
This is the default for the BaseTemplate
commands, but can, obviously, be overridden in any particular command.
Paragraph
Every paragraph in the text inserted from the source document (which in the case of the BaseTemplate
command is actually the document issuing the BaseTemplate
command) into the destination (that is, the base template itself) is formatted according to the paragraph into which it is inserted.
For example, if the «DocumentBody»
Fillpoint in the base template is fill justified, font Century Gothic and indented 2cm, then that is how all the paragraphs inserted from the source template will be formatted, regardless of how they appear in that source template.
Destination
No explicit reformatting is done. This is an interesting situation because it relies on Word’s interpretation of styles, etc. to come into effect. It is best described by an example.
Suppose the source template (the one whose text is being included into the destination template) has a Normal style which has font Arial and Space After 6 points. And suppose the Normal style in the destination template has font Courier New 18 points and Space After of 24 points. When a paragraph from the source template, in the Normal style, is inserted into the destination template, it will assume the styling of the destination’s Normal style, that is 18 point Courier New with Space After of 24 points.
You can see that as long as the design of the styles in the two templates is carefully organized, this can be a very powerful feature.
This is the default for IncludeTemplate
and InsertTemplate
.
Text
This will cause only the unformatted text of the source template to be included, without paragraph or line marks.