HI,
I need some smart guru to show
me how to write text to a the
line after the end of a file.
I am so confused and do not
understand how to.
Thanks.
Evan
Printable View
HI,
I need some smart guru to show
me how to write text to a the
line after the end of a file.
I am so confused and do not
understand how to.
Thanks.
Evan
if you mean AT the end and not AFTER the end it's:
Code:Open "FileName" for Append As #1
Theres a file that says
HI
and I want to make it say
HI
How are you
And I really dont know anything
I need more code.. like all of it
please.
then:
that's all it takes.Code:Open "FileWithHI" For Append As #1
Print #1, "How are you"
Close #1
Thanks alot
A little info on txt files
Code:'writing or reading data to or from a text file
'open for append adds the data to the end of file
'open for input opens the file for read only
'open for output opens the file and overwrites the file
'
'
Private Sub Command1_Click()
'this is the number of your file
Dim intFilenum As Integer
'set it to the next available free number
intFilenum = FreeFile
'this is your filename
Dim strFile As String
strFile = "A:\myfile.txt"
'this is the text you want to save (textbox)
Dim strText As String
strText = Text1.Text
'open the file for writing to as next freefile number
Open strFile For Append As intFilenum 'see above options
'write to the file
Write #intFilenum, strText 'to read use [input #filenum,strtext]
'close the file
Close intFilenum
End Sub
Thanks alot!