Open a file for writing to
Private Sub Form_Load()
Dim objFso As New FileSystemObject
Dim objFile As Object
Set objFile = objFso.OpenTextFile("f:\Test.txt", ForWriting)
objFile.Write "Hello World"
objFile.Close
End Sub
Notes:
Make sure you add a reference to the Microsoft Scripting library.
Change the file and path to one which you will write to.
|