使用mshtml.createDocumentFromUrl加载URL [英] loading a url using mshtml.createDocumentFromUrl

查看:159
本文介绍了使用mshtml.createDocumentFromUrl加载URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在尝试使用VB.NET中的函数时遇到了一些问题

createDocumentFromUrl但得到此错误..对象引用未设置

到对象的实例"。

这是我正在使用的代码


进口mshtml


Public DocumentFactory As HTMLDocument

公共函数GetWebPage(ByVal strURL As String)作为HTMLDocument

尝试

GetWebPage = DocumentFactory。 createDocumentFromUrl(strURL,vbNullString)

StatusBar1.Panels(1).Text = strURL

Do GetWebPage.readyState =" complete"

Application.DoEvents()

循环

Catch ex As Exception

MsgBox(ex.Message)

结束尝试

结束功能


我正在阅读类似的情况,但发布

回复的绅士已经发了一个附件,但不是再也找不到了。如果代码再次发布,我会很高兴。


提前感谢你,


Vibhu Bansal 。

Hello,
I am having certain problems in trying to use the function
createDocumentFromUrl in VB.NET but get this error.."Object reference not set
to an instance of object".
Here is the code that I am using

Imports mshtml

Public DocumentFactory As HTMLDocument
Public Function GetWebPage(ByVal strURL As String) As HTMLDocument
Try
GetWebPage = DocumentFactory.createDocumentFromUrl(strURL, vbNullString)
StatusBar1.Panels(1).Text = strURL
Do Until GetWebPage.readyState = "complete"
Application.DoEvents()
Loop
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function

I was reading through the similar situation but the gentleman posting the
reply has submiited a attachment which is not be found anymore. I would
greatly apprecitate if the code is posted again.

Thanking you in advance,

Vibhu Bansal.

推荐答案

继我的帖子之后,我需要使用IPersistStreamInit。我在这个论坛本身的

中读到了这个。但不幸的是,发布为

附件的解决方案文件丢失了。我会要求任何有线索的人尽快获得



Vibhu Bansal。
Further to my post, I need to use IPersistStreamInit. I was reading this in
this forum itself. But unfortunately, the solution file posted as an
attachment is missing. I would request anybody who has a clue to it to get
asap.
Vibhu Bansal.


继续我的帖子,我需要使用IPersistStreamInit。我在这个论坛本身的

中读到了这个。但不幸的是,发布为

附件的解决方案文件丢失了。我会要求任何有线索的人尽快获得



Vibhu Bansal。
Further to my post, I need to use IPersistStreamInit. I was reading this in
this forum itself. But unfortunately, the solution file posted as an
attachment is missing. I would request anybody who has a clue to it to get
asap.
Vibhu Bansal.


嗨查尔斯,

似乎附件没有发布。如果可以,请通过 vi****@hotmail.com

附件发送给我。

顺便说一句,绅士就是你自己,去年我在这个论坛上的某个时间读了这篇文章



Vibhu。


" Charles Law"写道:
Hi Charles,
It seems that the attachment is not getting posted. Please email the
attachment to me at vi****@hotmail.com if you can.
BTW, the gentleman is you itself and I was reading the post sometime of late
last year within this forum.
Vibhu.

"Charles Law" wrote:
你好Vibhu
Hi Vibhu
我正在阅读类似的情况,但发布
回复的绅士已经下了一个附件再也找不到了。如果代码再次发布,我会非常感激。
I was reading through the similar situation but the gentleman posting the
reply has submiited a attachment which is not be found anymore. I would
greatly apprecitate if the code is posted again.



你知道绅士的名字,以及发布的时间吗?



Do you know the Gentleman''s name, and when it was posted?

GetWebPage = DocumentFactory.createDocumentFromUrl(strURL,
vbNullString)
GetWebPage = DocumentFactory.createDocumentFromUrl(strURL,
vbNullString)



问题出在这里,因为还没有创建DocumentFactory。
试试附件。

HTH

$

" Vibhu Bansal" < Vibhu Ba****@discussions.microsoft.com >在消息中写道
新闻:50 ********************************** @ microsof t.com。 ..



The problem is here because DocumentFactory has not been created yet.

Try the attached.

HTH

Charles
"Vibhu Bansal" <Vibhu Ba****@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...

您好,
我在尝试使用VB.NET中的函数
createDocumentFromUrl但遇到此错误时遇到了一些问题。对象引用不是
设置
到对象的实例。
这是我正在使用的代码

进口mshtml

Public DocumentFactory As HTMLDocument
公共函数GetWebPage(ByVal strURL As String)作为HTMLDocument
尝试GetWebPage = DocumentFactory.createDocumentFromUrl(strURL,
vbNullString)
StatusBar1.Panels(1).Text = strURL <直到GetWebPage.readyState =" complete"
Application.DoEvents()
循环
Catch ex As Exception
MsgBox(ex.Message)
结束尝试结束功能

我正在阅读类似的情况,但发布
回复的绅士已经下载了一个不是f的附件再也好了。如果代码再次发布,我会非常感激。

提前感谢你,

Vibhu Bansal。
Hello,
I am having certain problems in trying to use the function
createDocumentFromUrl in VB.NET but get this error.."Object reference not
set
to an instance of object".
Here is the code that I am using

Imports mshtml

Public DocumentFactory As HTMLDocument
Public Function GetWebPage(ByVal strURL As String) As HTMLDocument
Try
GetWebPage = DocumentFactory.createDocumentFromUrl(strURL,
vbNullString)
StatusBar1.Panels(1).Text = strURL
Do Until GetWebPage.readyState = "complete"
Application.DoEvents()
Loop
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function

I was reading through the similar situation but the gentleman posting the
reply has submiited a attachment which is not be found anymore. I would
greatly apprecitate if the code is posted again.

Thanking you in advance,

Vibhu Bansal.



这篇关于使用mshtml.createDocumentFromUrl加载URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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