Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c:/>type abc.txt>prn equ command for vb

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
what is the equivalent command for the dos command

c:\>type abc.txt>prn to print the contents of the abc.txt file

what is the equivalent command for vb

thanks in advance

shanmugham
 
Use DOS:
----------------------------------------------------------
shell "c:\>type abc.txt>prn"
----------------------------------------------------------

or the VB way:
----------------------------------------------------------
Dim InFile as byte, MyStr as string

Infile = freefile
Open "c:\abc.txt" for binary access read as #infile
MyStr = space(lof(infile))
get #infile,,MyStr
Close #Infile

Printer.print MyStr
Printer.enddoc
---------------------------------------------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
There are three options.
- You can open the file read each line and print it using the LPrint command. If this stil exists in VB6 (it's a qbasic command).
You can also take a look at the CommonDialog object. This contains a Print option.
The third options is a bit more complicated. Use the Windows API to send a file to the printer. I have no idea which API this is, but this can be found in the MSDN library.

For more information on printing file, look in the MSDn library or VB help.

Arjan Meskers
 
Help!
I need to have a simple example of how to rename a file eg.
c:\abcd.txt to c:\fght.txt
 
whatisthis,

Rename a file in VB:

Name "c:\abcd.txt" as "c:\fght.txt"

Hope that is what you are looking for. Next time start a new thread instead of postsing in an existing... Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top