如何从ASP.NET打开现有的单词文档 [英] HOW TO OPEN EXSISTING WORD DOCUMENT FROM ASP.NET

查看:68
本文介绍了如何从ASP.NET打开现有的单词文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS2008和MS Office Word2007.最初,我在以下代码中遇到错误:
mw.Application wrdApp =新的mw.Application();

为了解决该问题,我使用了DCOMCNFG.我已经添加了ASPNET用户,并且已将身份设置为打孔"用户.现在,该问题已解决.

这是主要问题,当我使用以下语句时,我正在尝试打开文档.我没有任何异常,事件日志中也没有任何异常.但它不会打开文件.它只是挂了.我不知道该怎么办,该怎么办.

mw.Document wrdDoc = wrdDocs.Open(ref wdFile,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMiss ,ref oMissing,ref oMissing);










请帮忙.

谢谢和问候,
RAKESH

I am using VS2008 and MS office word 2007. Initially I was getting error at following code :
mw.Application wrdApp = new mw.Application();

To solve that problem, I used DCOMCNFG. I have added ASPNET user and I have set the identity to Lounching user. Now that problem is solved.

Here is main problem, when I use the following statement, I am trying to open the document. I do not get any exception as well as there isn''t anything in event log. but it doesn''t open the file. It just hangs. I don''t know what to do and what is worng.

mw.Document wrdDoc = wrdDocs.Open(ref wdFile,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing);










Please help.

Thanks and Regards,
RAKESH

推荐答案

尝试一下.

try this.

object oIsVisible=true;

mw.Document wrdDoc = wrdDocs.Open(ref wdFile,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oIsVisible);

wrdDoc .activate();


这篇关于如何从ASP.NET打开现有的单词文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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