InternetExplorer对象的使用
1、怎样使用InternetExplorer对象?
Dim IE As InternetExplorer
Set IE = CreateObject("internetexplorer.application")
IE.Navigate "http://www.chinaobs.com/default.aspx"
这样告诉我类型错误(第二句)
Dim IE
Set IE = CreateObject("internetexplorer.application")
IE.Navigate "http://www.chinaobs.com/default.aspx"
这样可以通过,但无法使用IE的事件(不只有没有?),也就是下一个问题
2、WebBrowser有加载页面结束的事件,如
Private Sub Web1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
MsgBox "ok"
End Sub
InternetExplorer有没有这样的事件?
Private Sub IE_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
MsgBox "ok"
End Sub
如果有,就必须这样来定义IE:Dim WithEvents IE As InternetExplorer
可是如果这样定义就会出现问题1
怎么办,望大侠们不吝赐教... ...
问题点数:30、回复次数:5Top
1 楼ChinaOBS(独孤丘雪(Excel终极伴侣---开辟Excel另类应用空间:http://www.ChinaOBS)回复于 2006-07-01 12:17:25 得分 0
Dim IE As New InternetExplorer
IE.Navigate "http://www.chinaobs.com/default.aspx"
这样也是通不过的... ...Top
2 楼TechnoFantasy((VB MVP)www.applevb.com)回复于 2006-07-01 12:51:07 得分 10
Dim ie As New InternetExplorer
Private Sub Command1_Click()
ie.Navigate "www.applevb.com"
ie.Visible = True
End Sub
可以啊,你引用Microsoft internet Control就可以了。Top
3 楼feiyun0112(http://feiyun0112.cnblogs.com/)回复于 2006-07-01 12:56:38 得分 10
Set objNewIE = New SHDocVw.InternetExplorer
引用
C:\WINDOWS\System32\shdocvw.dllTop
4 楼aspower_(敬个礼 握个手 大家都素好朋友!)回复于 2006-07-01 13:05:12 得分 10
Dim ie As Object
dim为object也可以的
Private Sub Command1_Click()
Set ie = CreateObject("internetexplorer.application")
ie.Navigate "www.applevb.com"
ie.Visible = True
End Sub
Top
5 楼ChinaOBS(独孤丘雪(Excel终极伴侣---开辟Excel另类应用空间:http://www.ChinaOBS)回复于 2006-07-01 21:02:37 得分 0
搞定了。
---------------------------
先添加WebBrowser控件,然后又引用了InternetExplorer... ...
此InternetExplorer 非彼InternetExplorer
-----------------------------
接分吧... ...Top




