CodeItBetter Programming Another VB Programming Blog

How to Print a Text file

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
'Miscellaneous - How to Print a Text file

'Add a Text Box to your form and set it's MultiLine property to True

Private Sub Form_Load()
    Dim sFile As String
    sFile = "C:\Temp\Test.txt"
    Open sFile For Input As #1
    Text1.Text = Input(LOF(1), #1)
    Close
    Printer.Print Text1.Text
    Printer.EndDoc
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.