Private Sub Command1_Click()
strHtml = "<html><body><table border=2 width=300 height=200><tr><td></td></tr></table></body></html>"
wb.Navigate "about:blank"
wb.Document.write strHtml
wb.ExecWB 7, 1
End Sub
用webbrower控件
请看下例
’声明:该程序由csdn论坛获得
dim dwinfolder as new shellwindows
dim withevents eventie as webbrowser_v1
private sub command1_click()
dim objie as object
for each objie in dwinfolder
if objie.locationurl = list1.list(list1.listindex) then
set eventie = objie
command1.enabled = false
list1.enabled = false
text1.text = ""
exit for
end if
next
end sub
private sub eventie_navigatecomplete(byval url as string)
text1.text = text1.text + chr(13) + chr(10) + url
end sub
在运行前。点击菜单 projects | references 项,在available references 列表中选择microsoft internet controls项将internet对象引用介入到工程中
private sub form_load()
dim objie as object
for each objie in dwinfolder
if instr(1, objie.fullname, "iexplore.exe", vbtextcompare) <> 0 then
list1.additem objie.locationurl
end if
next
command1.caption = "正文"
end sub
private sub form_unload(cancel as integer)
set dwinfolder = nothing
end sub
private sub list1_click()
dim objdoc as object
dim objie as object
for each objie in dwinfolder
if objie.locationurl = list1.list(list1.listindex) then
set objdoc = objie.document
for i = 1 to objdoc.all.length - 1
if objdoc.all(i).tagname = "body" then
text1.text = objdoc.all(i).innertext
end if
next
exit for
end if
next
end sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)