2003 服务器下asp.net生成word 不配置权限怎么弄?
程序伊甸园 2013-11-01 01:47:03 asp.net 常用的生成word功能,代码也是网上常见的,自己本地反复测试过没问题。
serves 2003下运行下出现问题,在本地就行,本地也是sever2003的系统,组件权限已配置
网上常见的模版生成法:
Document MyDoc = wordApp.Documents.Add(ref tempName, ref missing, ref missing, ref missing);
到这里时出错,显示Word出现问题.
html生成word,在加载html文件时出错(Word.Selection.InsertFile):
System.Runtime.InteropServices.COMException (0x800A1499): 文档名或其路径无效。 (D:\web\temp\63384007.html)
在 Microsoft.Office.Interop.Word.Selection.InsertFile(String FileName, Object& Range, Object& ConfirmConversions, Object& Link, Object& Attachment)
文件存在,目录权限也有。
保存word文档时也出错(Word.DocumentClass.SaveAs):
System.Runtime.InteropServices.COMException (0x800A1066): 命令失败
在 Microsoft.Office.Interop.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)
word已经正常安装,组件也应该被程序正常加载,代码没问题,网站是用asp.net2.0开发的,其它功能都没问题,可是就是导出word出错,应该是win2008设置的问题,可实在找不出是什么原因?????