PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > WPRINT command
WPRINT command

Allows to print the current Word document, and set some properties and options.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('WPRINT')

CHGVAR

VAR(&PARM1) VALUE('

[Printer="Printer name"]

[;TrayID=Tray ID]

[;Tray="Tray name"]

[;Copies=Copies number]

[;BackGround=True/False]
[;Pages="
Pages to print"]

[;PageType=Pages type]

[;FirstPageTray= Tray ID or name]

[;OtherPagesTray Tray ID or name]

[;OutFile="Output file"]

[Execute=True/False]

')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT))

MONMSG

MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

 

Parameters

 

Parameters

 

Parm1

or

Parm2


Printer
is the name of the printer. If this parameter is not present, printing is done on the Windows default printer (see Control Panel).

TrayID is a tray identifier. The possible values ​​are listed below.

Tray is the name of the bin. You must specify a string as it appears in the the properties of the printer.

Copies is the number of copies to print.

BackGround: True/False. False by default. To print in the background.

PageType is the type of pages to print, can take one of the following constant values:

wdPrintAllPages: print even and odd pages
wdPrintEvenPagesOnly: print even pages
wdPrintOddPagesOnly. : print odd pages

 

Pages is the number of pages and/or the range of pages to print, separated by commas (,).
For example, "2, 6-10" means: print page 2 and pages 6 to 10.

FirstPageTray is the identifier or name of the bin for the first page. The possible values ​​for the identifier are listed below.

OtherPagesTray is the identifier or the name of the bin for the following pages. The possible values ​​for the identifier are listed below.

OutFile: Full path to an output file that will receive the print stream.

Execute: If "Execute" is false, then the properties of the document are changed (Copies, Pages, Trays, ...) but the document is not printed.

 

 

 

Notes

1)

All parameters are optional.

 

2)

Possible values for Tray ID :

wdPrinterAutomaticSheetFeed ; wdPrinterDefaultBin ; wdPrinterEnvelopeFeedwd ; PrinterFormSource ; wdPrinterLargeCapacityBin ; wdPrinterLargeFormatBin ; wdPrinterLowerBin ; wdPrinterManualEnvelopeFeed ; wdPrinterManualFeed ; wdPrinterMiddleBin ; wdPrinterOnlyBin ; wdPrinterPaperCassette ; wdPrinterSmallFormalBin ; wdPrinterTractorFeed ; wdPrinterUpperBin

 

Be careful, these constants do not seem to be allowed with some printers. It is therefore better to use the name of the bin. 

 

Example

 

CHGVAR

VAR(&CMD) VALUE('WPRINT')

CHGVAR

VAR(&PARM1) VALUE('Printer="Brother HL-1270N +

series on Ne00"; Copies=2;+

TrayID=wdPrinterLowerBin;BackGround=False;+

Pages="2,4"')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT))

MONMSG

MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

 

 

 

 

See also

IFSPUT

CRTPRNSPLF - CL Command

SETPRINTER

WPRINTOUT