VBScript Word document code works server side but not client side
Posted on 2006-07-18
I have code the opens a word document from a template and populates some tables. It works great if I run it on the web server, save the file, and email it to the client then delete the file (so they don't stack up on the server). I would rather just open the document on the clients workstation (they all have word), populate it, and let them save it where they want. I found that changing my <% %> to <script language=vbscript></script> causes the word document to open on the client like I want. The template opens, but it won't insert the text into the table. Why does the exact same code work on the server, but not the client?
Set objWord = CreateObject("Word.Application")
objWord.Visible = true
Set WordDoc = objWord.Documents.Add("\\okctonerweb1\WebTemplates\IncidentExportWord_new.dot")
.Tables(1).Cell(1, 1).Range.InsertAfter ("Test")