Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
guys,
do you know how to create a text file using FileSystemObjects in Visual Basic 6.0?
thanks in advance....

Yes, don't use the FSO for a start. It cumbersome, slow and heavy on resources and has no place in VB6. If you intend distributing you application, using the FSO can add another couple of Mbs to the distribution files. It was designed to be used with VB scripting and just happens to be usable in VB 6.
Open "Test.txt" For Output As #1 will create an empty file in the default folder. The file name can can contain a fully qualified path name.
Write #1, "Text string" with write the string to the file
Close #1 will close the file.
One the file is created Open "Test.txt" For Input As #1 to read the file. This will create an error if the file does not exist.
Look up Open, Read, Write, Print and Input statements in the VB help files for for all the possible uses and parameters.
Stuart

![]() |
AnyOne Knows VB!
|
HTML - Forms below each o...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |