命令失败:在Microsoft.Office.Interop.Word.DocumentClass.SaveAs [英] command failed : at Microsoft.Office.Interop.Word.DocumentClass.SaveAs

查看:346
本文介绍了命令失败:在Microsoft.Office.Interop.Word.DocumentClass.SaveAs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过代码创建一个word文档,并将其作为.mht文件保存到文件系统中。它在我的开发服务器上工作正常,这是一个Windows Server 2003.当我将它部署到生产服务器(Windows服务器2008)时,我得到一个错误代码到达saveas步骤 -


 aDoc.SaveAs(ref saveHtmlFileName,ref saveFormat,ref missing,ref missing,ref missing,ref missing,ref missing,ref失踪,参考缺失,参考缺失,参考缺失,参考缺失,参考缺失,参考缺失,参考缺失,参考缺失); 

解决方案

您是否确认生产服务器已安装所有先决条件?例如,可能是您没有安装Office主互操作程序集。

如果您需要更多帮助,请指定您正在使用的Office,Visual Studio或VSTO版本。

米。

I am creating a word document through code and saving it as a .mht file to the file system. It works fine on my dev server which is a windows server 2003. When I deploy it to the production server (windows server 2008), I get an error when the code gets to saveas step -

aDoc.SaveAs(ref saveHtmlFileName, ref saveFormat, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

解决方案

have you verified that the production server has all the prerequisites installed?  for example, it may be that you don't have the Office primary interop assemblies installed.

if you need more help, please specify what version of Office, Visual Studio, or VSTO that you're using. 

m.


这篇关于命令失败:在Microsoft.Office.Interop.Word.DocumentClass.SaveAs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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