Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer preferences

Status
Not open for further replies.

Mrall

Programmer
Nov 22, 2008
64
US
I know that I can select which printer to use by
SET PRINTER TO NAME GETPRINTER()

Is there a good routine or method to use to set all the preferences like what word or just about any other program does.

Thanks
 
report form ...... to printer prompt

will cause the printer dialog to appear and that has the printer preferences button and dialog.

if you want to call the page setup direct (and remember what was chosen see sys(1037) and its variants in the help guide.)

or, if printing from for instance the tx text control, you can use the windows API.


DECLARE INTEGER OpenPrinter IN winspool.drv;
STRING pPrinterName, INTEGER @phPrinter, INTEGER pDefault

DECLARE INTEGER ClosePrinter IN winspool.drv INTEGER hPrinter

DECLARE INTEGER DocumentProperties IN winspool.drv;
INTEGER HWND, INTEGER hPrinter, STRING pDeviceName,;
STRING @pDevModeOutput, STRING @pDevModeInput, INTEGER fMode


but that means messing about with the devmode structure which is not for the faint-hearted.

hth

Nigel
 
Mrall,

If you refering to the post I made, the only problem with that method is the printer name (or device name) is limited to 32 characters. I have since corrected that, and made into a class, you can find it here.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top