Library code snippets
Advancing the Webbrowser Control
By Kym Manson, published on 29 Mar 2002
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
Related articles
Related discussion
-
VB6, SQL 2005 & DMO
by elajaunie3 (1 replies)
-
sending sms from pc
by sriraj20074 (0 replies)
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Click a link: Browser1.Navigate "javascript:document.links[1].click();"
Submit a form: Browser1.Navigate "javascript:document.formName.submit();"
If you read more about the DOM and javascript you can do almost anything using the browser control. You can experiment with this javascript by just typing it into the address bar.
This thread is for discussions of Advancing the Webbrowser Control.