|
-
Feb 19th, 2001, 05:59 PM
#1
Thread Starter
Lively Member
Hi All,
How do you print a simple Text file through code?
-
Feb 19th, 2001, 06:03 PM
#2
Code:
Open "File.txt" For Input As #1
strTemp = Input(LOF(1),1)
Printer.Print strTemp
Printer.EndDoc
Close #1
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 19th, 2001, 06:06 PM
#3
_______
<?>
Get up to get a tea and someone beats you to the punch! 
Code:
'Read a complete file instead of line by line
Option Explicit
Private Sub Command1_Click()
Dim sfile As String, intNum As Integer
Dim sString As String
intNum = FreeFile
sfile = "C:\my Documents\myfile.txt"
Open sfile For Input As intNum
sString = StrConv(InputB(LOF(intNum), intNum), vbUnicode)
Close intNum
Printer.Print sString
Printer.EndDoc
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Feb 19th, 2001, 06:08 PM
#4
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 19th, 2001, 06:27 PM
#5
Thread Starter
Lively Member
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
|