Read and Write a file(Notpad) through VB
Read and Write a file(Notpad) through VB
Rate Read and Write a file(Notpad) through VB
(1(1 Vote))
'Create a txt document in desktop named "Text.txt"
'Add a command button and a textbox
'Set" multiline = true" of textbox
Private Sub Command1_Click()
Open "C:\WINDOWS\Desktop\Text.txt" For Output As #1
Print #1, Text1.Text
Close #1
chg = 0
End Sub
Private Sub Form_Activate()
On Erorr GoTo fileError
Open "C:\WINDOWS\Desktop\Text.txt" For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1
Exit Sub
fileError:
MsgBox " Error"
End Sub
Read and Write a file(Notpad) through VB Comments
No comments yet — be the first to post one!
Post a Comment