Microsoft.Office.Interop.Word.DocumentClass.SaveAs 命令失败

asp.net 常用的生成word功能,代码也是网上常见的,自己本地反复测试过没问题。
serves 2003下运行没问题,可是发布到2008上就出错。组件权限已配置,windows目录下temp权限已给,程序目录权限已给,也加入了<identity impersonate="true" userName="administrator" password="XXXXX"/>,连administrator的用户控制都关了。

 

保存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)

 

64位服务器布置跟32位的区别是:

  C:\Windows\SysWOW64\config\systemprofile\Desktop
  C:\Windows\System32\config\systemprofile\Desktop

就是看下上面的文件夹有没?没有新建个文件夹就行了,泥马的困扰俺这么久!

 

记在上面以备后用

posted @ 2014-10-29 11:46  奇想  阅读(4067)  评论(0编辑  收藏  举报