The above code is not working.Please correct errors if anyVB Code:
Const forreading = 1, Forwriting = 2 Dim fs, f Private Sub Form_Load() CommonDialog1.Filter = "All Files(*.*)|*.*|Text files(*.*)|*.txt" CommonDialog1.FilterIndex = 2 CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then Set f = fs.opentextfile(CommonDialog1.FileName, forreading) Text1.Text = f.readall f.Close :confused: End If End Sub
P.S It should prompt a dialog box and open a text file .




Reply With Quote