Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

VB create text file

Name: Anonymous 2011-06-02 0:37

Is there a way of creating a text file based on a variable?

Dim fso, MyFile
Dim fname As String

fso = CreateObject("Scripting.FileSystemObject")

MyFile = fso.CreateTextFile("c:\address\fname.txt", True)

MyFile.WriteLine(TextBox1.Text)
MyFile.WriteLine(TextBox2.Text)
MyFile.WriteLine(TextBox3.Text)

MsgBox("File Created!")

MyFile.Close()

Example

basically i want to use textbox1.text as the filename, instead of declaring the filename in MyFile

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List