how do i put visual basic output into a text file?
Ryan H
2009-11-29 19:13:05 UTC
I am reading lines from a text file, and i want to put the output lines into a new text file, but i'm not sure how to do that
Three answers:
Naresh
2009-11-30 17:19:24 UTC
Writing text into a text file is so easy in Visual Basic. To do so:
Goto Project menu and click on References then in the list box choose 'Microsoft scripting runtime' and click on OK.
Assume that you have read a text file and put it into a text box named 'text1' and a command button named 'command1'
Now in Visual Basic Code window type the following code segment.
sub command1_Click()
dim FSO as new FileSystemObject
dim TS as TextStream
set TS=FSO.CreateTextFile("C:\myfile.txt")
TS.Write Text1.Text
TS.Close
end sub
And Finished
Its Very Easy Isn't It?
fipps
2016-10-17 09:08:28 UTC
assume you desire to maintain a attractiveness that an person inputs. then you definately can attempt here call a variable ex. 'a' then code a=text1.text textile text1 is the call of the text textile container the place the person inputs. in case you have a database then shop all those information there. you like separate coding for database connectivity. Then once you could desire to coach the enter in an prolonged time you could retrieve the archives from database and coach. in case you could desire to maintain the archives contained in this device then call distinctive person inputs by distinctive variable and shop them.
-DC-
2009-11-29 19:17:00 UTC
Got Google?
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.