Hi there
I am trying to read all of the data from a .rtf file and write it to a Rich Text Box. Now, I have done the same with a .dat file before, with the following code, and it works:
VB Code:
Dim strData As String Dim hFile As Long Dim sFilename As String sFilename = ".\file.dat" hFile = FreeFile Open sFilename For Input As #hFile strData = Input$(LOF(hFile), hFile) Close #hFile
But when I use file.rtf file in place of file.dat, then it throws the following error:
Run-time error '62'
Input past end of file
Any idea how I could make this work?
Many thanks
langals




Reply With Quote