Hi all I want to open a text file to put in it one string and after that to close it. Can you give me some code examples.
Thanks in advance
Bezbojnika
Printable View
Hi all I want to open a text file to put in it one string and after that to close it. Can you give me some code examples.
Thanks in advance
Bezbojnika
Hey man. You can use this:Hope this helps!VB Code:
Open App.Path & "\Test.txt" For Append As #1 Print #1, "I am inputting this string" Close #1
Yes that was great for me,
i have only one question how to clear all content of the text file before insert the string.
i wan it to be empty.
Thanks.
If you want to overwrite the text file, use Output instead of Append in the Open statement.
As kberry79 said, just use this:VB Code:
Open App.Path & "\Test.txt" For Output As #1 Print #1, "I am inputting this string into an empty file" Close #1