2018.1

Table Of Contents
Defining parts
Defining parts is done by setting the part field on a section, for example:
merge.template.contexts.PRINT.sections['Section 2'].part = "PDF_Attachment2";. (Also
see "section" on page1084 and "Control Script API" on page1077.)
l If a part name is given, then that delimits the start of a new part (even if the part name is
the same as the previous one). Following sections that don't define a part name, will be
added to the previous part.
l A part ends at the last enabled* section or at the last section before the start of a new part.
*When a Control Script has set the enabled field of a section to false, it will not be
outputted.
If no part name is set on any section, it is assumed that there is only one part, consisting of the
default section (for Web output) or of all sections (for Print output). The attachment(s) will be
named after the email subject.
Examples
No parts defined
Assume there are three Print sections: sections A, B and C. When generating Email output with
the Print context as attachment, all three Print sections will be put together in one file and
attached to the email. If the email's subject is 'Take action', the name of the attached file will be
'Take action.PDF'.
Splitting and renaming a Print attachment
Assume there are three Print sections: sections A, B and C. In a Control Script a part name is
defined for section C:
var section = merge.template.contexts.PRINT.sections['Section C'];
section.part = 'Part2';
When generating Email output with the Print context as attachment, the email will have two
attachments:
l attachment 1: Section A, Section B
l attachment 2: "Part2", which is Section C. The file name of this attachment is the part
name.
Page 717