September 10, 2001 - Controlling Selective Printing | WebReference

September 10, 2001 - Controlling Selective Printing

Yehuda Shiran September 10, 2001
Controlling Selective Printing
Tips: September 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

The TemplatePrinter element supports selective printing. You can choose from within JavaScript if you want to print a selected portion of the document. If the TemplatePrinter's ID is printer, you would turn on selective printing by going:

printer.selectedPages = true;
Set selectedPages to false to print all pages. You can set and get the first and last pages of the selection range. You can change them from within the script, or you can have them modified by the user in the print dialog window. Any user's changes are reflected in the script as well. Use printer.pageFrom to find the first selected page. Use printer.pageTo to find the last selected page. To set the first selected page to 5 and the last page to 12, you would go:

printer.pageFrom = 5;
printer.pageTo = 12;
To learn more about print templates, read Column 89 (Print Templates, Part I) and Column 91 (Print Templates, Part II: TemplatePrinter.) Download the Microsoft print template loader.