Serial letters with NotesToPaper
The sample database "NTP 6.0 Serial Letter"(NTPSL.NSF), which is included in the standard installation of NotesToPaper, serves as a practical example.
Design (or alternatively: Have someone design) the letter structure with NotesToPaper Setup either in accordance with precise specifications (CD/CI) or your own individual requirements.
The central function/option of NotesToPaper for controlling the serial letter functionality is NTPOPTION_RESET_PROJECT_STATE (1). It ensures that the entire project is reset after each data set. If the option is activated then the entire layout is reset to the initial state after each data set (NTPEndDocument) - so as if the first page is just being printed.
The sample script shows you how to proceed:
After the usual initialization of a new report, you activate the serial letter function NTPOPTION_RESET_PROJECT_STATE (1). The current example shows you an additional function, which is especially useful for creating serial letters - the replacement of place holders/variables (2), in order to personalize e. g. the main text. For reasons of simplicity all place holders are replaced by product names here.
This is followed by the loop for the export of the actual serial letter data:
The address information (3) and the main text (4) combined form the first serial letter. By activating the serial letter function (1) the entire layout is reset after saving the data set (5), as described above. In this case the process repeats itself until the loop can no longer find any documents.
After you have ended the data transfer with NTPEnd, the serial letter will be produced with the final function NTPProcessReportExt.
PS: By extending/changing the script you can save the serial letter as PDF to the file system - alternatively or cumulatively separate for each addressee.