Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working out the current default printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01300801
Message ID:
01301342
Vues:
17
Assuming that there is some type of User table in existance (or one can be created) how big of PITA would it be to just save the last printer they used? Then the application could remember what printer was used last and display it as the default selection next time the used wants to print something - unless they're going through the "Select Printer" options in some other fashion than your application.

As far as a separate interface for this, I'm not seeing that issue. I used to have an object that was nothing more than 3 radio buttons - Print to 1) Screen 2) File 3) Printer (with a drop list of the printer names with the default printer displayed at the top when this option was selected).

Another question I would ask, however, is: Does the user WANT to set a 'default Fox' printer other than their default Windows printer. In my experience, users generally liked the option of printing to another network printer - but actually doing so was a rare instance.

>Getting the default printer name is no problem. What is a problem is remembering what printer a user printed to. By that, I mean that if the user has printer 1 set as default, but prints something and chooses printer 2, I'd like to be able to determine that they printed to printer 2 and bring that up as the selected printer next time they print. Can't do it. The default printer has not changed, so the next time they print it will come up as the selected printer. You can use SET PRINTER as you mention, but you have to have a separate interface for this. If they set it to printer 2 via this technique, then they print to printer 3, you can't "remember" that and bring up printer 3 as the default printer the next time because you can't tell what printer they printed to. You're always hamstrung by not knowing the printer they actually printed to, which may not be the default and may not be the one that was set with SET PRINTER.
>
>
>>I know there's an API call through the WSH that will give you the installed printer names but I don't remember if it will tell you which one is currently set as default.
>>
>>And the command "Set Printer to Name [printername]" should work, although it's been awhile since I last used it.
>>
>>>>Hi
>>>>
>>>>What's the easiest way to work out the name of the default printer?
>>>
>>>The problem in all of this is determining which printer a user printed to. I'd like to just use the PROMPT keyword in a REPORT FORM command and let the user choose any printer they want to. Then I'd like to be able to find out which one they chose and set that as the VFP default printer, but there's no way to do that in VFP and I'm not even sure of an API call to do it. So you have to do something like make them choose the printer first, then print to it, which is a little alien to the normal way that users are used to doing it. Indicate they want to print something, then choose the printer.
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform