auto fill on the web forms..
I'm still some trouble and not get anywhere, I'm writing program of automatically fill out the forms for (first name and last name and home addresss) on the web browser by click one button and automatically fill out, I'm not sure how i can write code in VB. Does any one can help me how to write that so i can undersand myself from there thanks.
Re: auto fill on the web forms..
This will log you into gamespot, might gets some ideas fom it,
VB Code:
Option Explicit
Private WithEvents strtxtBox As HTMLTextAreaElement
Private IE As InternetExplorer
Private WithEvents strEmail As HTMLTextAreaElement
Private Sub Command1_Click()
Set IE = New InternetExplorer
With IE
.Visible = True
.navigate "www.gamespot.com"
End With
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Set strtxtBox = IE.document.Forms(0).PASSWORD
Set strEmail = IE.document.Forms(0).EMAILADDR
strtxtBox.innerText = "pass"
IE.document.frames.execScript "document.login.submit()", "JavaScript"
End Sub
Creates a new instance of IE but can use it with the WB control, change a couple of lines.
You need to set references for "Microsoft Internet controls" and "Microsoft HTML Object library".
Re: auto fill on the web forms..
you dont need the withevents ....
(dont even need the HTML object in some cases)
using the webbrowser control
Webbrowser1.Document.All.NAMEOFFIELD.Value = "Data"
so, if in the HTML source of the page.. u see the text field Name="fName" then
Webbrowser1.Document.All.fName.Value = "Data"
to submit
Webbrowser1.Document.All.submit.Click
usually works.
now u can get really deep into things sometimes.. all depends on the page being filled.
post the URL and I will help more in the am ;)