REM TEACHING SCRIPT - Prints each page to separate file [CorelSCRIPT 8]
REM PrintOnePage.csc February 5, 1998
REM ⌐ 1998 Corel Corporation. All rights reserved.
REM ************************************************************************************
REM This script prints the active Ventura publication to a file, one page at a time,
REM using the default Ventura print style. To customize this script for your own
REM use, edit the predefined GLOBAL CONST variables that follow this comment.
REM Note - There is no error checking implemented in this script. It is assumed that you
REM have an open publication, and provide valid values for the variables.
REM *************************************************************************************
REM Edit this value to reflect the name of the printer you wish to use.
GLOBAL CONST PRINTER_NAME$ = "HP LaserJet 4M Plus,LPT1:" ' Complete name and path of printer (get this from the Ventura print dialog, or by recording the .FilePRint command)
REM Edit this value to specify the print style you wish to use.
GLOBAL CONST PRINT_STYLE$ = "CorelVentura 8.0 Defaults" ' Complete name and path of printer (get this from the Ventura print dialog, or by recording the .FilePRint command)
REM Edit this value to specify the directory in which to place the print files.
GLOBAL CONST DEFAULT_DIRECTORY$ = "C:\Temp\" ' Directory in which to place Print files
REM Edit this variable to specify the root name of the print file.
GLOBAL CONST PRINT_FILE$ = "PrintFile" ' Root name of print file (eg. PrintFile -> PrintFile1.prn)
' This section declares the subroutines used within the script
' Note - The EventHandler subroutine is not declared here, as it is defined after being called.
DECLARE SUB GetPrintInfo
DECLARE SUB PrintPub
DECLARE SUB PrintPages
' This section defines some values that will be used further down into the script
#DEFINE PRINT_SPECIFIED_PAGES 3 ' Used by FilePrint command to indicate the range of pages to print
#DEFINE OBJECT_VENTURA "CorelVentura.Automation.8" ' For ease of porting to VP8
' Constants for Dialog Return Values
GLOBAL CONST DIALOG_RETURN_CANCEL% = 2
GLOBAL CONST DIALOG_RETURN_NEXT% = 3
' Constants for Dynamic Dialog Events
#DEFINE EVENT_INITIALIZATION 0
#DEFINE EVENT_CHANGE_IN_CONTENT 1
#DEFINE EVENT_MOUSE_CLICK 2
' Constants for Dynamic Dialog Styles
#DEFINE STYLE_SUNKEN &h0100
' Constants for print range
GLOBAL CONST PRINT_PUB% = 0 ' variable indicating print range as entire publication
GLOBAL CONST PRINT_PAGE% = 1 ' variable indicating print range as specified pages
' Global variables(need to be global to be used by Event Handler)
GLOBAL StartPage$ ' the first page in range (used if pages is the selected range)
GLOBAL EndPage$ ' the last page in range (used if pages is the selected range)
StartPage$="1"
EndPage$="1"
'//// MAIN //////////////////////////////////////////////////////////////////