General information
Category:
Windows API functions
Title:
SetDefaultPrinter Problem
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
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