Results 1 to 2 of 2

Thread: Really easy question

  1. #1
    Guest

    Post

    This may sound dumb but for some reason in vb6 my project will not open files as it did in vb5, but only opens the last line. I dont have any help files. Please send any source code to open a .txt file.

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    This will open a text file and put it in a TextBox:

    Code:
    Dim FileNum As Byte, FileName As String
    FileName = InputBox("Enter the full path of a text file to open:")
    If (Len(FileName) = 0) Or (Len(Dir(FileName)) = 0) Then Exit Sub
    FileNum = FreeFile
    Open FileName For Input As #FileNum
        Text1.Text = Input(LOF(FileNum), #FileNum)
    Close #FileNum
    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879
    AIM: RYoni69


    [This message has been edited by Yonatan (edited 12-29-1999).]

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