Tore already answered your question and I can only repeat his advice - if something is not working as intended, you need to verify the command(s) in Help.
>I was using this Code
>
>lcOldPrinter = set('printer')
>lcPrinter = getprinter()
>if !empty(lcPrinter)
> set printer to NAME (lcPrinter)
>Endif
>
>copy file (fullpath("E:\Bills\lap\1010461602.ps")) to printer
>
>
>set printer TO Name(lcOldPrinter)
>=messagebox(m.lcOldPrinter)
>
>=messagebox(m.lcOldPrinter) is Giving message as "OFF"
>
>
>>>Using your Earlier suggested code, i.e copy copy file (fullpath("E:\Bills\lap\1010461602.ps")) to printer, a file named printer is created in the working directory and no output is generated in printer.
>>>
>>>Second, set printer TO Name(lcOldPrinter) i.e Last Line is also giving the same spool Error
>>>
>>>Regards
>>>Harsh
>>>
>>>
>>What is lcOldPrinter ? Can you post
>>=messagebox(m.lcOldPrinter)
If it's not broken, fix it until it is.
My Blog