Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing text file to dot matrix printer
Message
De
14/08/2001 14:03:40
 
 
À
14/08/2001 07:48:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00543414
Message ID:
00543647
Vues:
15
hi Yashodhan

the ??? has the disadvantage of spitting out blank pages before printing. i have found the easiest way is using an API as follows:

if file("yourfile.txt")
DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING @SourceFileName, ;
STRING @DestFileName, ;
INTEGER bFailIfExists
CopyFile("yourfile.txt","LPT1:",0)
else
messagebox('File not available for printing...',0+48+0,'Printer Error....')
endi
*The following are valid examples of invoking CopyFile() after it was DECLARED:
*CopyFile('C:\MyFile','LPT1:',0) && LPT1:
*CopyFile('D:\Temp\MyFile','PRN:',0) && the default printer
*CopyFile('\\MyServer\MyShare\MyFile','\\SomeServer\SharedPrinter',0)

hth
john
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform