Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting windows printer programatically
Message
From
24/08/1999 07:51:43
 
 
To
24/08/1999 05:08:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00256943
Message ID:
00256972
Views:
21
>>I haven been trying to store the windows printer name in a variable or property with Var = SET(Printer,3). When I try to restore the setting by issuing SET PRINTER TO NAME Var OR SET PRINTER TO NAME &Var, I get an error accessing the spooler. I can type the actual names in the command window and never have a problem. This only occurs when I try to use a variable. Is there a trick to this? Thanks.
>

>
>See the Following Code and get some idea!
>
>
>PrintJob
>
>PR = GETPRINTER()
>
>IF Empty("&PR")
>   Return && User Cancel Printing
>ENDIF
>
>Set Printer to "&PR"
>
>_pbpage = 1
>_pepage = 9999
>
>If Thisform.OptPrint.Value = 1
>   Report Form myReport to Printer NoConsole
>Else
>   Report Form myReport Preview
>Endif
>
>EndPrint
>

>
>

>
>Notice:
>
>Set Printer to Name \\MyServer\MyPrinterName
>

Thgis form only works correctly under NT; you need to specify a Windows name and not a UNC under Win9x.

>if you add a word "Name" at end!
>
>Set Printer to "Espon LQ-1070"
>
>if in normal way!
>
>^_~ Good Luck!
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform