错误创建Word对象在传统的ASP IIS7上 [英] Error creating Word object in classic ASP on IIS7

查看:200
本文介绍了错误创建Word对象在传统的ASP IIS7上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在从Windows 2000 / IIS 4盒转换我们的内网到Windows 2008 / IIS 7箱的中间。只是做了直接转换,现在,着眼于未来的重建在C#.NET一些应用程序。

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.

,老有Word 2003中。

New server has Word 2010 installed, old has Word 2003.

运行与传统的ASP应用程序的问题。尝试基于模板的文档创建和修改Word文档。

Running into an issue with a classic ASP app. Attempting to create and modify a Word document based on a template document.

接收以下错误:

Microsoft VBScript runtime error '800a01a8' 

Object required: 'Documents.Open(...)'

在code则尝试运行如下:

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

有没有以下行:

Set wrdDoc = wrdObj.Documents.Open(docRoot & docName)

我已经做了一堆的搜索摆在那里,但没有多少人似乎使用Word 2010自动化传统的ASP一些奇怪的原因...:)

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... :)

推荐答案

我是运行到Windows Server 2008上的64位版本类似的东西,并试图一些Excel自动化。显然,64位版本有一些办公自动化的问题。我不知道他们是否扩展到所有办公自动化,或者如果它只是Excel中,但这里是我用来解决我的问题的链接。

I was running into something similar on the 64-bit version of Windows Server 2008 and attempting some Excel automation. Apparently the 64-bit version has some Office automation issues. I'm not sure if they extend to all of Office Automation, or if it's just Excel, but here is the link that I used to fix my problem.

<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required\" rel=\"nofollow\">http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required

我创造了第二个帖子中提到的文件夹,它的工作就像一个魅力。

I created the folders mentioned in the 2nd post, and it worked like a charm.

这篇关于错误创建Word对象在传统的ASP IIS7上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆