Hi All,
This question is for my husband (I don't have much experience with web page creation, but lots with VFP & COM). He is working on a project creating a Web application. He is using ASP to create the pages. The data is stored in SQL 7. What he wants to do is have a button on an ASP created Web page that the user can click to generate a Word Document report from the SQL 7 data. Before/After creation of the Word document the user is prompted to save it on their hard drive. I think he needs to do some VB scripting.
Something along the lines of:
SQL = SELECT customer, widget from CustWidget where customer = 'SMITH'
set rs = Conn.Execute(sql)
set oWord = CreateObject('Word.Application')
set oDocument = oWord.Documents.Add()
set oRange = oDocument.Range()
oRange.InsertAfter('Customer ID:'+ rs('customer')+ CHR(13) )
oRange.InsertAfter('WigitID:'+ rs('widget')+ CHR(13) )
.
.
.
** finished creating Word document
** ...prompt user for file name
oWord.ActiveDocument.SaveAs(lcFileName)
Is this the correct syntax? Does the whole block of code have to be wrapped in %?
TIA,
Jacci