调用Word.SaveAs方法时报“COMException(0x800a1066)命令失败”的错误
我们服务器的环境为2003 Server, MS.net FrameWork 2.0, Office 2003,之前安装的网站一直运行正常,Word也能正常操作,上周因为一次突发停电,重启以后Word就出问题了,创建Word.Application和Word.Document都没问题,调用Word自动化的一些方法也没问题,一到保存就出错,我上网查了好几天都没找到问题原因,请高手帮帮忙,感激不尽!
因为代码我没动过,只是服务器断了一次电,所以我先把代码这方面原因排除了。
附上应用程序事件信息:
事件代码: 3005
事件消息: 发生了未处理的异常。
事件时间: 2009-11-2 11:04:40
事件时间(UTC): 2009-11-2 3:04:40
事件 ID: a780ee3fe74349729c5292a1e569f4c5
事件序列: 137
事件匹配项: 1
事件详细信息代码: 0
应用程序信息:
应用程序域: /LM/W3SVC/1/Root/Index-3-129016041197812500
信任级别: Full
应用程序虚拟路径: /Index
应用程序路径: c:\inetpub\wwwroot\Index\
计算机名: STSERVER
进程信息:
进程 ID: 4160
进程名: w3wp.exe
帐户名: NT AUTHORITY\NETWORK SERVICE
异常信息:
异常类型: COMException
异常消息: 命令失败
请求信息:
请求 URL: http://10.15.123.137/Index/WebUI/TestPlanFrame/TestPlanContent.aspx?TPID=1280
请求路径: /Index/WebUI/TestPlanFrame/TestPlanContent.aspx
用户主机地址: 10.15.117.127
用户:
是否已经过身份验证: False
身份验证类型:
线程帐户名: NT AUTHORITY\NETWORK SERVICE
线程信息:
线程 ID: 11
线程帐户名: NT AUTHORITY\NETWORK SERVICE
是否正在模拟: False
堆栈跟踪: 在 Word.DocumentClass.SaveAs(Object& FileName, Object& FileFormat, Object& LockComments, Object& Password, Object& AddToRecentFiles, Object& WritePassword, Object& ReadOnlyRecommended, Object& EmbedTrueTypeFonts, Object& SaveNativePictureFormat, Object& SaveFormsData, Object& SaveAsAOCELetter, Object& Encoding, Object& InsertLineBreaks, Object& AllowSubstitutions, Object& LineEnding, Object& AddBiDiMarks)
在 WebUI.TestPlanFrame.TestPlanContent.CreateWordFile(String strFileName) 位置 c:\Inetpub\wwwroot\Index\WebUI\TestPlanFrame\TestPlanContent.aspx.cs:行号 432
在 WebUI.TestPlanFrame.TestPlanContent.ExportBtn_Click(Object sender, EventArgs e) 位置 c:\Inetpub\wwwroot\Index\WebUI\TestPlanFrame\TestPlanContent.aspx.cs:行号 371
在 System.Web.UI.WebControls.Button.OnClick(EventArgs e)
在 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
自定义事件详细信息:
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。