Tutorial Videos

Tutorial videos are available here.

Knowledge Base

Visit our User Forum for discussions & solutions

IncludeTemplate – XpressDox

An entire template file can be inserted into the document using the «IncludeTemplate» command. The included template can contain Fillpoint definitions and even issue further IncludeTemplate commands.  It is treated thereafter exactly as if the contents of that included template had been typed directly into the including template.

The description of the parties is: «IncludeTemplate(PartyDescription)»

The IncludeTemplate command can also be issued conditionally.

The description of the parties is: «If(Party = 'Company')»«IncludeTemplate(PartyDescription)»«End()»

Notice that ‘PartyDescription’ is regarded by XpressDox as a file name – when no extension is supplied, XpressDox uses the XpressDox Template extension, that is ‘.xdtpx’ or ‘.xdtpm’. (Prior to version 4, the XpressDox Template extension was ‘xdtpl’.)

Also take care that if the file name contains a period (fullstop), then the extension MUST be provided.  For example:


Notice also that the full path of the included template is not specified. In a case like this, XpressDox will assume that the included template is in the same folder as the original template.

Please see the notes on configuring Helper Folders, for further template referencing features.

Please also see source and destination formatting with BaseTemplate, IncludeTemplate and InsertTemplate for more important information on the very flexible way that XpressDox has of formatting the result document.

The command «IncludeTemplateText» is similar to «IncludeTemplate», but the unformatted text of the template is all that is inserted.

Preserving Headers and Footers

By default the IncludeTemplate command will strip out the included template’s headers and footers (in fact all section information including the section breaks at the end of sections) before including the text into the destination template.  But if you would like those headers and footers  (and all the section information) included into the destination template, then the PreserveHeaders parameter needs to be specified in the command.  An example would look like this:


When including a template with the PreserveHeaders option, you would need to precede the IncludeTemplate command in the including template with a Word section break in order to make sure that any section information in the including template is preserved in the correct position in the merged document.

Definition of an Assembly

A number of XpressDox features operate not so much at the level of a template, but at the level of an assembly. An assembly is the document which results from all the BaseTemplate and IncludeTemplate (and IncludeCodeTemplate) commands in the template and any templates included via those commands.
In particular, the construction of the XpressDox interview is performed using all the fillpoints defined in an assembly, in the sequence in which they appear in the assembly.