Results 1 to 3 of 3

Thread: More Open With... Problems

  1. #1

    Thread Starter
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340

    Question

    Yesterday, i had a problem having text files open with a text editor, by right clicking on them and then using the open with command. I fixed the problem by using the following code:

    Dim FName As String
    Dim FF As Integer

    If Command$ <> "" Then
    FName = Replace(Command$, Chr$(34), " ")
    FName = Trim$(FName)
    FF = FreeFile
    Open FName For Input As FF
    rtfText = Input(LOF(FF), FF)
    Close FF
    End If

    That allowed me to open text files by right clicking on them and then going to open with, and selecting my program. However, it seems that whenever i try to open certain text files, i get the following error:

    Run-time error '62':
    Input past end of file

    I am not sure, but i think that the error could be caused by the size of the text file that i am opening. It seemed to only happen when opening larger text files, but some larger text files i was able to open. If anyone has any ideas on how i can fix this problem i could really use the help.

  2. #2
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Did you use the search feature on our board to try and find an answer ?

    Try something like this this . Remember "EOF" End Of File

    Code:
    Open App.Path & "\fonts.dat" For Input As #1
                 While Not EOF(1)
                    Input #1, strFont$
                    Call cmbFonts.AddItem(strFont$)
                 Wend
            Close #1


    []P
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  3. #3
    Hyperactive Member D12Bit's Avatar
    Join Date
    Oct 2000
    Location
    Guatemala
    Posts
    373

    Exclamation

    Hi,

    do you need to open the file "For Input"?

    I had the same problem when use As Input when making a program to read the password of Access 2000 in some Databases and the problem was gone when i open the file using "For Binary".

    Hope this can help,

    Saludos...

    [Edited by D12Bit on 10-28-2000 at 04:07 PM]
    "Who Dares Wins" - "Quien se Arriesga Gana"
    Mail me at:

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