|
-
Mar 14th, 2006, 09:42 AM
#1
Thread Starter
New Member
Edit text file in vb 6.0
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
-
Mar 14th, 2006, 10:08 AM
#2
Fanatic Member
Re: Edit text file in vb 6.0
Hey man. You can use this:
VB Code:
Open App.Path & "\Test.txt" For Append As #1
Print #1, "I am inputting this string"
Close #1
Hope this helps!
-
Mar 14th, 2006, 10:33 AM
#3
Thread Starter
New Member
Re: Edit text file in vb 6.0
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.
-
Mar 14th, 2006, 10:36 AM
#4
Member
Re: Edit text file in vb 6.0
If you want to overwrite the text file, use Output instead of Append in the Open statement.
-
Mar 14th, 2006, 11:37 AM
#5
Fanatic Member
Re: Edit text file in vb 6.0
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|