Okay . . . I have a VBS that uses a series of prompts to acquire information. I would like to simplify it by creating an HTML form to collect the data; but have absolutely no idea on how to do this. Here is the original VBS:
[∞]MP
Code:
' Storage Organizer
'
' Application to record boxes in storage shed, and
' print labels to affix to the boxes.
'
'
' June 25, 2010
'
' RevC
'
' Declaring the variables
strDate = Date()
strName = InputBox("First and Last Name: ")
strDept = InputBox("Department: ")
strBoxNo = InputBox("Box Number: ")
strContents = InputBox("Contents: ")
strDestroy = InputBox("Destruction Date: ")
'Creating log.
Dim Stuff, logFSO, WriteStuff, dateStamp
strLog =strName & " from " & strDept & " sent box " & strBoxNo & " to the shed on " & strDate & ". It contained " & strContents & ", and is due for destruction on " & strDestroy & "."
strLog2 =strName & "," & strDept & "," & strBoxNo & "," & strDate & "," & strContents & "," & strDestroy
Set logFSO = CreateObject("Scripting.FileSystemObject")
Set WriteLog = logFSO.OpenTextFile("\\server2006\tech\log\Storage Log.txt", 8, True)
Set WriteLog2 = logFSO.OpenTextFile("\\server2006\tech\log\Storage Log2.csv", 8, True)
WriteLog.WriteLine(strLog)
WriteLog.Close
WriteLog2.WriteLine(strLog2)
WriteLog2.Close
SET WriteLog = NOTHING
SET logFSO = NOTHING
' Binding to Excel object.
Set objExcel = CreateObject("Excel.Application")
'Configuring view during creation.
objExcel.Visible = False
'Opening template.
objExcel.Workbooks.Open("\\server2006\tech\boxlabel\labeltemplate.xlsx")
' Bind to existing worksheet (w1).
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Name = "Box Label"
' Populating first portion of spreadsheet (w1).
objSheet.Cells(1, 2).Value =Left(strDept,1)
objSheet.Cells(1, 3).Value =strBoxNo
objSheet.Cells(3, 1).Value =strDate
objSheet.Cells(3, 4).Value =strDestroy
' AutoFit Cells on w1.
objExcel.Range("b2:B4").Select
objExcel.Cells.EntireColumn.AutoFit
' Populate the rest of the worksheet.
objSheet.Cells(5, 1).Value =strName
objSheet.Cells(7, 4).Value =strcontents
objSheet.Cells(6, 1).Value =strDept
' Print w1.
objExcel.ActiveWorkbook.PrintOut
' Close w1, supressing prompt.
objExcel.ActiveWorkbook.Close(False)
'Opening template.
objExcel.Workbooks.Open("\\server2006\tech\boxlabel\reporttemplate.xlsx")
' Bind to existing worksheet (w2).
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Name = "Box Inventory"
' Populating first portion of spreadsheet (w2).
objSheet.Cells(1, 2).Value =Left(strDept,1)
objSheet.Cells(1, 3).Value =strBoxNo
objSheet.Cells(3, 2).Value =strDate
objSheet.Cells(5, 2).Value =strName
objSheet.Cells(6, 2).Value =strDept
objSheet.Cells(8, 2).Value =strDestroy
objSheet.Cells(10, 2).Value =strContents + "."
' AutoFit Cells on w2.
objExcel.Range("b2:B4").Select
objExcel.Cells.EntireColumn.AutoFit
' Print w2.
objExcel.ActiveWorkbook.PrintOut
' Close w2, supressing prompt.
objExcel.ActiveWorkbook.Close(False)
' Exit Excel
objExcel.Quit
[∞]MP