tim900000
October 16th, 2001, 05:01 PM
I have a program that determins whether a text file exists or not and works fine if it does exist.
If the file does not exist, how do I write the vb code to create it?
Thanks in advance...
If Dir("C:\abc.txt") = "" then
MsgBox "File with settings does not exist"
else
FileNum = FreeFile
Open "c:\abc.txt" for input as #FileNum
for i = 0 to 23
input #FileNum, Reading
Text1(i) = Reading
next
Close #FileNum
End If
If the file does not exist, how do I write the vb code to create it?
Thanks in advance...
If Dir("C:\abc.txt") = "" then
MsgBox "File with settings does not exist"
else
FileNum = FreeFile
Open "c:\abc.txt" for input as #FileNum
for i = 0 to 23
input #FileNum, Reading
Text1(i) = Reading
next
Close #FileNum
End If