General information
Category:
Coding, syntax & commands
Not exactly the answer, but why don't you use the plain:
copy filename to (printer_name) &&for network printers, or
copy filename to (printer_port) &&for local printers
>Hi folks,
>
>I create an ASCII text log file which I want printing out to the default printer (which in my case is a network printer). I've tried using both the rawprint library and also the copyfile() api but can't seem to get either to work. Do I need to send control chars as well ?
>Here is the rawprint test prg I'm using...
>
>cfiletoprt = GETFILE()
>
>Set Classlib To rawprint
>vprdev=CreateObject("PrintDev")
>
>vprdev.cprintername = SET("PRINTER", 3)
>vprdev.cfilename = cfiletoprt
>If vprdev.oOpen()
> if !vprdev.oPrintFile()
> MessageBox("Error sending to printer")
> endif
> vprdev.oClose()
>Else
> MessageBox("OpenPrinter() Error: "+str(oPrnDev.nOpenError))
>Endif
>
>Release vprdev
>Set Classlib to
>
>Not sure what I'm missing. Would be grateful if anyone point me in the right direction.
>
>Regards
>
>Kal
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only