Jobs
Author: S Lord X Date Submitted: 1/9/2006 Category: Other Compatibility: VB 6 This code has been accessed 5739 times.
Email Yourself this snippet:
'make sure to add reference to the Microsoft Scripting Runtime library. ' A form with a create button.
Code
Dim FSO as new FileSystemObject Dim txt as TextStream Private Sub Create_Click() mkdir("d:\\My Folder") chdir("D:\\My Folder") Set txt = FSO.CreateTextFile("D:\\My Folder\\My File.txt",TRUE) txt.WriteLine("This is a sample text.") txt.Write ("this is on the same line!") txt.WriteBlankLines (10) 'writes 10 blank lines txt.WriteLine("Ending text!!!!") 'ending text txt.close End Sub