In the middle of converting our Intranet from a Windows 2000/IIS 4 box to a Windows 2008/IIS 7 box. Just doing a straight conversion for now, with an eye on redeveloping some apps in C#.NET in the future.
New server has Word 2010 installed, old has Word 2003.
Running into an issue with a classic ASP app. Attempting to create and modify a Word document based on a template document.
Receiving following error:
Microsoft VBScript runtime error '800a01a8'
Object required: 'Documents.Open(...)'
The code it is attempting to run is as follows:
Dim wrdObj
Set wrdObj = Server.CreateObject("Word.application")
Dim wrdDoc
Set wrdDoc = Server.CreateObject("Word.Document")
Set wrdDoc = wrdObj.Documents.Open(docRoot & docName)
' Do word assignments
With wrdDoc
.Variables("Today").Value = rs.Fields.Item("TODAY").Value & " "
.Variables("Requester").Value = Request.QueryString("strUser") & " "
.Variables("Ship_Comp").Value = rs.Fields.Item("TXT_VENDOR_NAME").Value & " "
.Variables("Ship_Addr").Value = rs.Fields.Item("ADDR").Value & " "
.Variables("Ship_City").Value = rs.Fields.Item("CITY").Value & " " & rs.Fields.Item("STATE_ZIP").Value
.Variables("Ship_Country").Value = rs.Fields.Item("COUNTRY").Value & " "
.Fields.Update
.Save
End With
'wrdDoc.Section
wrdDoc.Close
Set wrdDoc = Nothing
wrdObj.Quit
Set wrdObj = Nothing
It is failing on the following line:
Set wrdDoc = wrdObj.Documents.Open(docRoot & docName)
I've done a bunch of searches out there, but not many people appear to be using Word 2010 automation in classic ASP for some strange reason... :)