There's an error in the sample code. It should be
MessageBox("OpenPrinter() Error: "+str(vprdev.nOpenError))
>The error actually happens from the rawprint program that I downloaded from the Universal Thread. Here is the code from that program. This is right out of the sample program that came with the rawprint class.
>
>Param cfiletoprt, cprinter
>
>If pcount()<2
> ? 'Do prtfile with "File to print", "printer name"'
> ?
> ? 'Eg. Do PrtFile with "TestPrint.prn", "Generic / Text Only"'
> ?
> return
>Endif
>
>Set Classlib To rawprint
>vprdev=CreateObject("PrintDev")
>
>vprdev.cprintername = cprinter
>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
>
>Return
--sb--