Home > How-To Library > Internet
How to Auto-fill web forms
**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * **************************************************************** Option Explicit 'set references for "Microsoft Internet controls" and "Microsoft HTML Object library". 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 'the following lines will use the text box names from the site to identify the '<input type="text" name="EMAILADDR" class="mr5" style="width:100px;" Set strtxtBox = IE.document.Forms(0).PASSWORD Set strEmail = IE.document.Forms(0).EMAILADDR strtxtBox.innerText = "pass" strEmail.innerText = "email@hotmail.com" IE.document.frames.execScript "document.login.submit()", "JavaScript" End Sub
If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.