Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STRTOFILE writes to file with printer name
Message
De
05/09/2001 08:25:32
 
 
À
04/09/2001 08:59:04
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00552012
Message ID:
00552426
Vues:
17
>have seen examples that indicated you could specify a printer name
>in the STRTOFILE command and send a string to the specified printer.
>
>i tried the following, but instead of sending the output to the
>selected printer, the output was sent to a file (in the current
>directory). of course the filename is the name of the
>printer that i specified.
>
>
>lc_Printer_Name = ALLTRIM(GETPRINTER())
>lc_File_Contents = FILETOSTR(lc_Source_File_Spec)
>ln_Chars = STRTOFILE( lc_File_Contents , lc_Printer_Name , .T. )
>
>
>how can i get it to go to the printer ?

Download my DIRPRTCLASS from the Files section - it would look something like:
SET PROC TO DIRPRTCLASS ADDITIVE
oPrt = CREATEOBJ('DirectPrintOutput')
WITH oPrt
   .PrinterOpen(lc_Printer_Name)
   .DocOpen()
   .DocWrite(lc_File_Contents) && you can have several .DocWrite() lines to merge into a spool file
   .DocClose()
ENDWITH

OR

WITH oPrt
   .PrinterOpen(lc_Printer_Name)
   .SpoolFile(lc_Source_File_Spec)  && add <b>, .T. </b> before closing ) to delete after print
ENDWITH
You also need ClsHeap, also available in the Files Section. Documentation for both classes in in the header contents of the source code, so be sure to read the code.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform