Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending a .TXT file to a printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00157423
Message ID:
00157614
Vues:
18
>Ok, I think I'm suffering from cerebral flatulence.
>
>I need to send a .TXT file to a laser printer. Is there an easy way to do this? I've thought of creating a cursor with a memo field, appending the file, and using a report form to print the field, but it seems kind of kludgy.
>
>Any suggestions?

Let's see; the native TYPE command in VFP should be able to do what you want with the TO PRINTER clause. TYPE can provide limited formatting, headings, etc.

If you don't need to format the file at all , and you know the name of the printer as a device, you can use COPY FILE (or better, the CopyFile() API call) to send the file to a print port (either a local port or a UNC.) If you want some formatting, and assuming that you have a .TXT file associationon the user's machine, you could use ShellExecute() to print it for you. By default, there's a PRINT action associated with .TXT files in Win95/98/NT that uses NOTEPAD to print the file; ShellExecute() allows you to specify the action in addition to the file name, and lets the OLE Server app handle the details.

And then you can get really creative...
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform