Results 1 to 4 of 4

Thread: Reading from .rtf file [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    105

    Reading from .rtf file [RESOLVED]

    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:
    1. Dim strData As String
    2.     Dim hFile As Long
    3.     Dim sFilename As String
    4.    
    5.     sFilename = ".\file.dat"
    6.     hFile = FreeFile
    7.     Open sFilename For Input As #hFile
    8.       strData = Input$(LOF(hFile), hFile)
    9.     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
    Last edited by langals; May 11th, 2005 at 10:44 AM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width