Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing text file to dot matrix printer
Message
From
14/08/2001 14:03:40
 
 
To
14/08/2001 07:48:01
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00543414
Message ID:
00543647
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform