Dim filenm As Integer
filenm = FreeFile
Open "d:\demo.txt" For Input As filenm
Dim str As String
Do While Not EOF(filenm)
Input #filenm, str
Label1.Caption = Label1.Caption + vbCrLf + str
Loop
Open "d:\readme.txt" For Output As #1
Print #1, Text1.Text
Close 1
Open "d:\readme.txt" For Append As #1
Print #1, Text1.Text
Close 1
filenm = FreeFile
Open "d:\demo.txt" For Input As filenm
Dim str As String
Do While Not EOF(filenm)
Input #filenm, str
Label1.Caption = Label1.Caption + vbCrLf + str
Loop
Open "d:\readme.txt" For Output As #1
Print #1, Text1.Text
Close 1
Appending text in a file without overwriting content
Open "d:\readme.txt" For Append As #1
Print #1, Text1.Text
Close 1
No comments:
Post a Comment