.... Same Exact question - SAME PROBLEMS!!
I am trying to do the SAME thing and getting nowhere. You would think this would be pretty easy but I guess not. Here is the code I am using. Maybe you or someone else can get this to work.
Sub CreateWordDoc()
Dim owd
set owd = Server.CreateObject("Word.Application")
owd.Documents.Open ("c:\worddocs\lt-2-a.doc")
owd.Selection.Find.Execute "{First Name}", , , , , , , , , "David", 2
owd.Selection.Find.Execute "{Last Name}", , , , , , , , , "Adams", 2
owd.Selection.Find.Execute "{Address}", , , , , , , , , "Main St", 2
owd.Documents.SaveAs ("c:\worddocs\temp.doc")
owd.Documents.Close (0)
owd.quit
Set owd= Nothing
End Sub
I have also put the following line of code in this page and have tried it in global.asa as well. (I've also left it out with the same results)
<!--METADATA TYPE="TypeLib" NAME="Microsoft Word 9.0 Object Library" UUID="{000209FF-0000-0000-C000-000000000046}" VERSION="8.1"-->
When I run this code in straight vb and set a reference to the word 9.0 library, it runs perfectly - but when I run this from and asp page, it chokes out at the "set owd = Server.CreateObject("Word.Application")" line. It either hangs completely at this line or returns a "cannot create object" error. I can create "Excel.Application" objects just fine. What is really strange is that winword.exe opens each time I refresh or run this page and will not close! Like I said, this works fine with VB..
I have full control permissions (You really only need delete, write, read) set up for the IUSER guest account. I also have Word 2K installed on the web server which is Win2K.
This is where I got my information from..
http://msdn.microsoft.com/library/pe...00/asp0071.htm
I believe it mentions that if this app will receive a lot of traffic that you should create the object in global.asa and simply refer to that object in your code. I had zero success with this as well.
This has been totally frustrating and if anyone can help us out it would be a HUGE help!!!