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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Files From a template

Status
Not open for further replies.

walderr

Programmer
Jul 18, 2003
32
GB
This should be fairly simple: I want to write variables sumbitted via a form to a template, which is then saved as a different name. I can get the basic principle to work, but I want to include a template file as the variable 'htm' rather than write the whole thing out as it's a large(ish) template - the variable I have for htm currently does this as shown below, but I want to use something more along the lines of the commented out htm shown, although for some reason it can't find the file specified. Hope that makes sense.

dim fso, txt, path, html
'create the path
FileDay = left(RODate,2)
FileMonth = mid(RODate,4,2)
path = Server.MapPath("Reports\"&Customer&"_"&FileDay&"-"&FileMonth&".htm")
set fso = Server.CreateObject("Scripting.FileSystemObject")
'htm = fso.GetFile("Includes\ReportTemplate.asp")
htm = &quot;<html><head><title>Report Submitted</title></head><body>&quot;&Customer&&quot;</body></html>&quot;
set txt = fso_OpenTextFile(path, 2, true) 'create the html file
txt.WriteLine(htm)
set txt = nothing
set fso = nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top