Results 1 to 8 of 8

Thread: How to open files using dialog box

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    9

    Question How to open files using dialog box

    VB Code:
    1. Const forreading = 1, Forwriting = 2
    2. Dim fs, f
    3.  
    4. Private Sub Form_Load()
    5. CommonDialog1.Filter = "All Files(*.*)|*.*|Text files(*.*)|*.txt"
    6. CommonDialog1.FilterIndex = 2
    7. CommonDialog1.ShowOpen
    8. If CommonDialog1.FileName <> "" Then
    9. Set f = fs.opentextfile(CommonDialog1.FileName, forreading)
    10. Text1.Text = f.readall
    11. f.Close :confused:
    12. End If
    13. End Sub
    The above code is not working.Please correct errors if any

    P.S It should prompt a dialog box and open a text file .
    Last edited by vbanswers; Sep 13th, 2006 at 11:00 PM. Reason: code missing

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