Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Print the contents of a text file. ...
Author:
Kip Densley
Submitted:
2/22/2002
Version:
VB6
Compatibility:
VB6
Category:
String Manipulation
Views:
16209
Print the contents of a text file.
Declarations:
'Include Microsoft scripting runtime in your project.
Code:
Private Sub PrintTxtFile(sFile As String) Dim tsText As Scripting.TextStream Dim fsFileObj As New Scripting.FileSystemObject Dim fpTxtFile As File Dim sLine As String Set fpTxtFile = fsFileObj.GetFile(sFile) Set tsText = fpTxtFile.OpenAsTextStream(ForReading, TristateUseDefault) Do While Not tsText.AtEndOfStream sLine = tsText.ReadLine Printer.Print sLine Loop Printer.EndDoc End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement