Creating a file with VB?

JustinSampson

Senior member
Aug 11, 2001
481
0
0
Hello,
I was wondering if anyone new how to create a new file in Visual Basic 6. The name will come from a variable and the content's will come from a variable. I can't find any tutorials on how to do it, the only ones I found were how to open, edit, and save files.

Thanks for the help,
Justin Sampson
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
(from MSDN)
Open Statement
If the file specified by pathname doesn't exist, it is created when a file is opened for Append, Binary, Output, or Random modes.

stuff = "Hey at MS we worship anagram Santa! Ho, Ho, Ho"
Open "c:\JunkyFile.txt" For Output As #1
Put #1, stuff
Close #1