Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I save a string to a file?

Status
Not open for further replies.

dellyjm

Programmer
Apr 13, 2000
168
0
0
JM
Hi i currently am trying to write an application that will save a string to a file name. It is not working. When i use the file scripting object and save it, the file isnot saved properly. When I copy and paste the same file into notepad it works well. I dunno what to do. FIle type is .XML.

Delton.
 
try
Set lfso = New FileSystemObject
fso.CreateTextFile (FileLocation)
Set lfil = lfso.GetFile(FileLocation)
Set lts = lfil.OpenAsTextStream(ForWriting)
lts.writeline (STRINGVARIABLE)
lts.close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top