private sub mnuscroll1_click() '注意:必須在網(wǎng)頁完全顯示之后才可以運行 webbrowser1.document.body.scroll = "no" '不顯示滾動條的辦法 end sub private sub mnuscroll2_click() '注意:必須在網(wǎng)頁完全顯示之后才可以運行 webbrowser1.document.body.scroll = "auto" '顯示滾動條的辦法 end sub
2、如何獲得網(wǎng)頁中被選中部分的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