English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am using Visual Basic 6.0 and need to write the contents of ONE text box to a txt file. Every time it is clicked it should add a new line with the contents of the text box (Not write over the old one) How would I go about doing this?

2007-08-09 18:54:34 · 2 answers · asked by Paul K 1 in Computers & Internet Programming & Design

2 answers

Try the following code:
Put this piece of code under click event of a button, it will create a file abc.txt in c:\ drive and append whatever is written in textbox.

Private Sub Command1_Click()
Open "C:\abc.txt" For Append As #1
Write #1, Text1.Text
Close (1)
End Sub

2007-08-09 21:44:17 · answer #1 · answered by iqbal 4 · 0 0

i contemplate whether VB is assuming which you desire a CSV report format. have you ever tried putting the straightforward verbal substitute clear out? CommonDialog1.clear out = "*.TXT" on each occasion I even have labored with records, I even have used the Scripting.FileSystemObject and Scripting.TextStream products. that is yet another highway to study, if the above would not artwork.

2016-10-09 21:59:14 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers