Display file contents in a text box
Display file contents in a text box
Rate Display file contents in a text box
(2(2 Vote))
'if put in a form then add a 'Private' keyword before function
'Pass the arguments sFileName as full path of a file and tBox as like Text1
Function GetFile(sFileName As String, tBox As TextBox) As Boolean
If Dir(sFileName, vbNormal) = "" Then
GetFile = False
Else
Dim sT As String
Open sFileName For Binary As #1
sT = Space(LOF(1))
Get #1, 1, sT
tBox.Text = sT
Close #1
GetFile = True
End If
End Function
Display file contents in a text box Comments
No comments yet — be the first to post one!
Post a Comment