private sub mnuscroll1_click() '注意:必须在网页完全显示之后才可以运行 webbrowser1.document.body.scroll = "no" '不显示滚动条的办法 end sub private sub mnuscroll2_click() '注意:必须在网页完全显示之后才可以运行 webbrowser1.document.body.scroll = "auto" '显示滚动条的办法 end sub
2、如何获得网页中被选中部分的html:
private sub command1_click() dim objselection dim objtxtrange
set objselection = webbrowser1.document.selection if not (objselection is nothing) then set objtxtrange = objselection.createrange if not (objtxtrange is nothing) then debug.print objtxtrange.htmltext
set objtxtrange = nothing end if set objselection = nothing end if end sub
private sub form_load() webbrowser1.navigate "http://www.applevb.com" end sub