Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 29,709 times

Downloads

Related Categories

Advancing the Webbrowser Control

Kimmy

You need to have "HTML Object Library" in the References window, and a webbrowser control (Microsoft Internet Controls). Once you've inserted this code into your project, you'll notice a new object in the Code window called mdocDocument. It has lots of events, such as: Click, Double Click, Mouse Move, KeyUp, KeyDown and lots more...

Place the following code in the General Declarations section

Private mhtmDoc3 As IHTMLDocument3
Private WithEvents mdocDocument As HTMLDocument

' When navigating to a new page, update the Object we're monitoring
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  Set mhtmDoc3 = WebBrowser1.Document
  Set mdocDocument = mhtmDoc3
End Sub

Till the Roof comes off Till the Lights go out Till my Legs give out Can't shut my mouth I will not fall, my Wisdoms all.

Comments

  • Posted by ravindra_perera on 01 Sep 2004

    Thanks a lot for the information given, it really helped me

  • Clicking Buttons

    Posted by Chrystof on 07 Apr 2003

    You can click buttons or links and submit forms using javascript.

    Click a link: Browser1.Navigate "javascript:document.links[1].click();"
    Submit a form: Browser1.Navigate "javascript:document.for...

  • Thanks

    Posted by ximo on 15 May 2002

    This is very useful if you want full control over the control and what's going on! but do you know how I can click a button of an html form within a document? I can't find anything about this on the n...