Private Sub cmdOpen_Click()
On Error GoTo OpenError
fnum = FreeFile
Open txtFileName For Input As fnum
txt = Input$(LOF(fnum), #fnum)
Close fnum
txtFileText = txt
Exit Sub
OpenError:
MsgBox "Error " & Format$(Err.Number) & _
" opening file." & vbCrLf & _
Err.Description
Exit Sub
End Sub
|