|
-
September 21st, 2001, 04:59 AM
#1
Silly, Print Help
I have a Txt file a.txt in c:
I want to take the print out of the file through DOs something like c:\a.txt > prn
I don't want any windows print out becaues it is too slow.
I am doing something like this :
a = Shell("cmd.exe")
SendKeys "Type C:\dirbat.txt >prn"
This opens too many dos prompts and there is no result at end.
I need this urgently,
Thanks,
Shivakumar G.M.
-
September 21st, 2001, 07:09 AM
#2
Re: Silly, Print Help
Maybe this can help, instead of sending the file to the printer, send the file to a .prn file, then shell a batch file that sends that file to the printer. Sending a .prn file to a printer can be done using copy, like this
copy output.prn LPT1
or
copy output.prn \\SomeServer\SomeSharedPrinter
This however requires that the file is printed to a file using the printer API's, like when you select the checkbox 'print to file' in the common dialog.
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
September 21st, 2001, 07:27 AM
#3
Re: Silly, Print Help
Would something like this work?
Open "C:\Print.bat" For Output As #1
Print #1, "Type C:\dirbat.txt > prn"
Close #1
Shell "C:\Print.bat", vbHide
-
September 22nd, 2001, 05:37 AM
#4
Re: Silly, Print Help
Thanks a lot, it works great.
sir, what I had done right now was, I made a EXE file in C which accepts a command line argument that is the name of the file like
shell("printMe a.txt")
The c file internally gives a command like
system("Type a.txt > PRN")
Your example works fine.
Thanks.
Shivakumar G.M.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|