Hi, guys. This is a VBS script that opens google, fills a form, and clicks a search button.
set ie = CreateObject("InternetExplorer.Application")
ie.navigate("www.google.com")
ie.visible = true
while ie.readystate <> 4
wscript.sleep 100
WEnd
set fields = ie.document.getelementsbyname("q")
set buttons = ie.document.getelementsbyname("btnG")
fields(0).value = "some query"
buttons(0).click
ie.quit
Sub OnClickSub()
MsgBox "button clicked!", 0
End Sub
Obviously, buttons(0).click
fires an onclick event of the button, which I somehow need to catch in my script, and provide it with some processing like launching OnClickSub()
.
Has anyone got any ideas how this should be done?