FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Printer Selection
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Printer Selection
Posted: Thu Nov 06, 2014 11:10 PM

Hello,

I need to print to a specific printer on a workstation without user interface.

I am using

PRINT oPrinter NAME "Labels" TO "MAR-ZM400"

It is going to the wrong printer even though printer name is correct.

Is there a way to get a list of printers on a workstation then select the appropriate printer and save for future use?

If someone could provide sample code, I would greatly appreciate it!

SIncerely,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Printer Selection
Posted: Thu Nov 06, 2014 11:31 PM
This is a simple printer selection function. You can save the result to dbf, ini, or other.

Code (fw): Select all Collapse
function myChoosePrinter()
   local aPrinters, cPrinter := ''
   local nPrinter := 0

   aPrinters := getprinters()
   nPrinter := MsgList( aPrinters, "Select Printer")

   if nPrinter != nil .and. nPrinter > 0
      cPrinter := aPrinters[ nPrinter ]
   endif
   // msginfo( cPrinter )
return( cPrinter )
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Printer Selection
Posted: Fri Nov 07, 2014 12:16 AM

Thanks Gale!

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com

Continue the discussion