Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetDefaultPrinter Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00940809
Message ID:
00940830
Vues:
10
This works for me:
set PRINTER TO NAME GETPRINTER()
? SET("PRINTER", 3) && Get the current default printer
lcdefault = SET("PRINTER", 3) && Get the current default printer
oNet.SetDefaultPrinter(lcDefault)
I guess I would verify the name of the printer in windows exactly.



>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.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform