2
Contributors
3
Replies
15
Views
4 Years
Discussion Span
Last Post by Aurax
0

Try something like this :

    Function FileText(ByVal filename As String) As String
        Dim handle As Integer

           ' ensure that the file exists
        If Len(Dir$(filename)) = 0 Then
            Err.Raise 53  ' File not found
        End If

           ' open in binary mode
        handle = FreeFile
        Open filename$ For Binary As #handle
           ' read the string and close the file
        FileText = Space$(LOF(handle))
        Get #handle, , FileText
        Close #handle
    End Function

Private Sub Command1_Click()
    Text1.Text = FileText("D:\image.txt")
End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.