2022.2

Table Of Contents
l
Apartendsatthelastenabled*sectionoratthelastsectionbeforethestartofanewpart.
*WhenaControlScripthassettheenabledfieldofasectiontofalse,itwillnotbeout-
putted.
Ifnopartnameissetonanysection,itisassumedthatthereisonlyonepart,consistingofallPrintsec-
tions.Theattachmentwillbenamedaftertheemailsubject.
Examples
No parts defined
AssumetherearethreePrintsections:sectionsA,BandC.WhengeneratingEmailoutputwiththe
Printcontextasattachment,allthreePrintsectionswillbeputtogetherinonefileandattachedtothe
email.Iftheemail'ssubjectis'Takeaction',thenameoftheattachedfilewillbe'Takeaction.PDF'.
Splitting and renaming a Print attachment
AssumetherearethreePrintsections:sectionsA,BandC.InaControlScriptapartnameisdefined
forsectionC:
var section = merge.template.contexts.PRINT.sections['Section C'];
section.part = 'Part2';
WhengeneratingEmailoutputwiththePrintcontextasattachment,theemailwillhavetwoattach-
ments:
l
attachment1:SectionA,SectionB
l
attachment2:"Part2",whichisSectionC.Thefilenameofthisattachmentisthepartname.
Controlling multiple Email attachments
Thefollowingscriptattachesthefollowingsectionstoanemail:
l
Printsection3+4asattachmentwithcontinuedpagenumbers
l
Printsection6asseparateattachment
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;
Page 403