Thanks to all who responded.
I was looking in the wrong place!

Dennis McGrath
Software Developer
QMI Security Solutions
1661 Glenlake Ave
Itasca IL 60143
630-980-8461
[email protected]
________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Paul Buckley
Sent: Friday, September 23, 2011 12:53 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: - Default Printer

Dennis,

Here is code provided by Razzak that does what you are looking for:

-- PickPrinterAndPrintReport.RMD
-- To print the report on available printers or the screen
-- Author: A. Razzak Memon
-- Created: January 3, 2006
-- Last Modified: November 15, 2006
IF (CVAL('DATABASE')) <> 'RRBYW14' OR (CVAL('DATABASE')) IS NULL THEN
   CONNECT RRBYW14 IDENTIFIED BY NONE
ENDIF
CLEAR VAR vAvailablePrinters,vItemCount,vDefaultPrinter,vSelectedPrinter
SET VAR vAvailablePrinters TEXT = NULL
SET VAR vItemCount INTEGER = NULL
SET VAR vDefaultPrinter TEXT = NULL
SET VAR vAvailablePrinters = ((CVAL('Printers'))+',Screen')
SET VAR vItemCount = (ITEMCNT(.vAvailablePrinters))
SET VAR vDefaultPrinter = (CVAL('WindowsPrinter'))
SET VAR vSelectedPrinter TEXT = NULL
CLS
CHOOSE vSelectedPrinter FROM #LIST .vAvailablePrinters +
CHKBOX 1 TITLE 'Select Appropriate Printer' +
CAPTION 'Available Printers' LINES .vItemCount FORMATTED +
OPTION LIST_FONT_COLOR MAROON +
|LIST_BACK_COLOR [R234,G234,B234] +
|TITLE_FONT_COLOR MAROON +
|TITLE_BACK_COLOR [R234,G234,B234] +
|WINDOW_BACK_COLOR [R234,G234,B234] +
|TITLE_FONT_NAME VERDANA +
|TITLE_FONT_SIZE 9 +
|TITLE_BOLD ON +
|WINDOW_CAPTION +
|BUTTONS_BACK_COLOR WHITE +
|BUTTONS_SHOW_GLYPH ON +
|THEMENAME R:BASE Rocks!
IF vSelectedPrinter IS NULL OR vSelectedPrinter = '[Esc]' THEN
    GOTO Done
ENDIF
IF vSelectedPrinter = 'Screen' THEN
   PRINT CustYellowPages +
   OPTION SCREEN|WINDOW_STATE MAXIMIZED +
   |ZOOM_TYPE PERCENTAGE|ZOOMPERCENT 90
   GOTO Done
ELSE
   PRNSETUP .vSelectedPrinter
   PRINT CustYellowPages OPTION PRINTER
   PRNSETUP .vDefaultPrinter
ENDIF
LABEL Done
CLS
CLEAR VAR vAvailablePrinters,vItemCount,vDefaultPrinter, +
vSelectedPrinter
RETURN


Feel free to use this.
Paul Buckley

From: [email protected] [mailto:[email protected]] On Behalf Of Dennis McGrath
Sent: Friday, September 23, 2011 1:12 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Default Printer

I'm using the
PRNSETUP printername
Command to change the default printer for my RBASE session.

I'd like to be able to capture the windows default printer to a variable so I 
can
Use prnsetup to switch default printers on demand.

Is there a way to do capture this name before I use PRNSETUP?


Dennis McGrath
Software Developer
QMI Security Solutions
1661 Glenlake Ave
Itasca IL 60143
630-980-8461
[email protected]<mailto:[email protected]>

Reply via email to