1.6

Table Of Contents
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.
Note
For Web sections, a part always consists of only the given section. Web pages cannot be appended
to form a single part. It is however possible to attach multiple Web pages to one email; see "Control
Script API" on page797 for an example.
Controlling multiple Email attachments
The following script attaches the following sections to an email:
l Print section 3 + 4 as attachment with continued page numbers
l Print section 6 as separate attachment
l Web sections A and B as separate attachments
if (channel == Channel.EMAIL) {// only when generating Email
output
if (merge.context.type == ContextType.PRINT) {
merge.context.sections['Section 1'].enabled = false;
merge.context.sections['Section 2'].enabled = false;
merge.context.sections['Section 3'].enabled = true;
merge.context.sections['Section 3'].part = "PDFAttach1";
merge.context.sections['Section 4'].enabled = true;
merge.context.sections['Section 4'].restartPageNumber = false;
merge.context.sections['Section 5'].enabled = false;
merge.context.sections['Section 6'].enabled = true;
merge.context.sections['Section 6'].part = "PDFAttach2";
Page 552