Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetDefaultPrinter Problem
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
SetDefaultPrinter Problem
Miscellaneous
Thread ID:
00940809
Message ID:
00940809
Views:
66
The following code gives me a "No such printer called -default printer-" (where "default printer" is the name of my default printer) error when I try to reset the printer back to the default. Anybody have any idea why?

onet = CREATEOBJECT("wscript.network")
lcdefault = SET(‘PRINTER', 2) && Get the current default printer
oNet.SetDefaultPrinter(lcDefault)

This is a Windows98 machine, running on a Novell network. The default printer is a local printer, not a network printer.

More info that may or not be related:
op = onet.EnumPrinterConnections
?op.Count returns 2 - or it only finds one printer. And it is not the current default printer that it returns.

aprinters() in FoxPro returns all 27 connected printers on the workstation. The Printers folder shows 27 different printers.
Next
Reply
Map
View

Click here to load this message in the networking platform