帮我修复错误document.Open()在microsoft.Office.Intorop.dll中什么都没有 [英] Help me fix error document.Open() is nothing in microsoft.Office.Intorop.dll

查看:73
本文介绍了帮我修复错误document.Open()在microsoft.Office.Intorop.dll中什么都没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我正在做一个网站,需要在网页中打开文档文档才能阅读,但是我正在使用microsoft.office.word.dll,但过程open()却什么也不返回.
您能帮我这个错误吗?非常感谢!
第一行发生错误:oDoc.Activate(),因为没有文档
这是我的代码:

Hi all!
I am doing a website, require open doc document in web page to read, but i am using microsoft.office.word.dll but procedure open() return nothing.
Can you help me this error?Thank so much!
error at line: oDoc.Activate() because nothing document
This my code:

Dim wordApp As New w.ApplicationClass()
                    Dim objFalse As Object = Nothing
                    Dim objTrue As Object = Nothing
                    Dim missing As Object = System.Reflection.Missing.Value
                    Dim emptyData As Object = String.Empty
                    wordApp.Visible = False
                    Dim oDoc As w.Document
                    oDoc = wordApp.Documents.Open(Server.MapPath(obj.FilePath), objFalse, objFalse, objFalse, missing, missing, missing, missing, missing, missing, missing, objTrue, missing, missing, missing)
                                    oDoc.Activate()
                    oDoc.Close()

推荐答案

服务器上是否已安装Word?这就是这段代码的运行位置.
Do you have Word installed on the server? That is where this code will run.


这篇关于帮我修复错误document.Open()在microsoft.Office.Intorop.dll中什么都没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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