错误读取通过IIS 7中使用Micorsoft.Office.Interop(对象库)的Word文档 [英] Error reading word doc using Micorsoft.Office.Interop(Object library) via IIS 7

查看:140
本文介绍了错误读取通过IIS 7中使用Micorsoft.Office.Interop(对象库)的Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

荫面临的问题,同时从IIS捉迷藏code时阅读文档。
它不是阅读文档和throwirng错误没有文件是opne试图保存时的ActiveDocument。

Iam facing issue while reading the document when runnning code from IIS. It is not reading the document and throwirng an error "No document is opne when trying to save the activedocument.".

 m_word.Documents.Open(ref FileName,
                                ref missing, ref readOnly, 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);


 m_word.ActiveDocument.SaveAs2(ref FileName_rtf, ref FileFormat, ref missing1, ref missing1,
                    ref missing1, ref missing1, ref missing1, ref missing1,
                    ref missing1, ref missing1, ref missing1,
                    ref missing1, ref missing1, ref missing1, ref missing1, ref missing1, ref missing1);

m_word.ActiveDocument从IIS中运行时,给错误。它是工作在Visual Studio调试模式。

m_word.ActiveDocument is giving error when running from IIS. It is working in visual studio debugging mode.

我也试过低于code:

I also tried the below code:

 Document doc_open =  m_word.Documents.Open(ref FileName,
                                ref missing, ref readOnly, 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);
            doc_open.Activate();

doc_open是retruning null,并且它在第二行抛出对象引用错误。当code是在调试模式下工作的。从IIS我们有IIS 7和MS办公室也开发服务器上运行时出现错误。

doc_open is retruning null and it throws object reference error in the second line. this works when code is in debugging mode. Error occurs when ran from IIS on development server where we have IIS 7 and MS offices too.

推荐答案

地址: C:\\ WINDOWS \\ Syswow64资料\\ CONFIG \\ systemprofile \\桌面

这是令人难以置信的成功。

It's incredibly successful.

这篇关于错误读取通过IIS 7中使用Micorsoft.Office.Interop(对象库)的Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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