View Single Post
  #2 (permalink)  
Old July 15th, 2005, 05:09 AM
pgtips pgtips is offline
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

use the Scripting.FileSystemObject, it has a CreateTextFile method which returns a TextStream object which you can use to write to the newly created file. Example from MSDN:
Sub CreateAfile
   Dim fso, MyFile
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
   MyFile.WriteLine("This is a test.")
   MyFile.Close
End Sub

hth
Phil
Reply With Quote