Menu

DOCX IMPORT

Provides a command for inserting other DOCX documents' contents into nearly any position of a DOCX template's own contents.

Commands of this library may only be used in DOCX document content.

importContent

Replaces contents of this command's content control with the contents of the specified DOCX document.

If the imported document is a template, it is imported before being appended. It can be Controller or Flow-based; if Flow-based, the Flow with the ID "compose" will be run. Commands in the imported template have access to all variables, except for external parameters, of this main template.

If this command's content control is in a paragraph with other content, the results vary slightly depending on the imported content. If the imported content consists of a single paragraph, that paragraph's content is merged into the paragraph surrounding the content control. If the imported content consists of more than one paragraph, the surrounding paragraph is split into two paragraphs and the content is placed between these two paragraphs.

Note that imported templates are not permitted to import or append more documents. Therefore the following commands are not evaluated if encountered during composing of an imported template:

The importContent command produces a local variable context that is the active context for the duration of the imported template's composing process. While most variables that the imported template's logic creates stay within this local context, be aware that any set commands may overwrite variables in the template initiating the importing.

Attributes

data

Required
Value type
EL-evaluated
Yes File Yes
Defines the document whose contents are to be imported. The resolved File should be a DOCX document.
renameConflictingStyles

Required
Value type
EL-evaluated
No Boolean No
Defines what will happen to styles in the imported content whose names conflict with styles in the base document. The importing process brings all styles of the imported document into the base document, but two styles with the same name cannot exist in a document and it is quite typical to have a style called "Normal", for example. Which "Normal" would an imported paragraph referring to a style with this name then take? This attribute offers two options to how such conflicts are resolved.

If this attribute's value is true, the conflict is resolved by renaming the conflicting styles of the imported content and bringing them into the base document with their new names. As the imported content's styles continue to exist in the resulting document with new names, all of the content preserves its original formatting. Do note that this causes any numbering sequence to restart as numberings are tied to specific styles.

If this attribute's value is false, the conflict is resolved by not bringing in the imported document's style into the base document. The imported content referring to a conflicting style will then start to refer to the style of the base document with the conflicting name. Any imported content referring to non-conflicting styles will still preserve its original look.

If undefined, the value false is used. 
test

Required
Value type
EL-evaluated
No Boolean Yes
This attribute can be used to make this command's content control a conditional element. If this attribute is undefined or if the resolved value is true, the command is evaluated normally and nothing special happens. If the resolved value is false, both the content control and any content inside it are removed and no content is imported.

Restrictions

The importContent command may be evaluated up to 20 times within a single evaluation process.

Comments

0 comments