|
|
|
|
|
|
Multiple Apps
|
Start web page that requires password (Log onto gmail)
|
|
Ease of Use
|
Hard
|
Version tested with
|
2003
|
Submitted by:
|
Oorang
|
Description:
|
This will show you how to take control of Internet Explorer, provide logon credentials, and sign into a website that requires a username and password.
|
Discussion:
|
This code requires you to know the control names of the username and password fields, and the submit button. This information is available in the source code of the login page of any website, but you must find it. A good starting place is to look for the keyword "name".
|
Code:
|
instructions for use
|
Public Sub LaunchGamil()
Const strURL_c As String = "http://mail.google.com"
Const strUsr_c As String = "1@2.3"
Const strPwd_c As String = "foobarbaz"
Dim objIE As SHDocVw.InternetExplorer
Dim ieDoc As MSHTML.HTMLDocument
Dim tbxPwdFld As MSHTML.HTMLInputElement
Dim tbxUsrFld As MSHTML.HTMLInputElement
Dim btnSubmit As MSHTML.HTMLInputElement
On Error GoTo Err_Hnd
Set objIE = New SHDocVw.InternetExplorer
objIE.Navigate strURL_c
Do Until objIE.ReadyState = READYSTATE_COMPLETE: Loop
Set ieDoc = objIE.Document
Set tbxPwdFld = ieDoc.all.Item("Passwd")
Set tbxUsrFld = ieDoc.all.Item("Email")
Set btnSubmit = ieDoc.all.Item("signIn")
tbxUsrFld.Value = strUsr_c
tbxPwdFld.Value = strPwd_c
btnSubmit.Click
Do Until objIE.ReadyState = READYSTATE_COMPLETE: Loop
Err_Hnd:
objIE.Visible = True
End Sub
|
How to use:
|
- Press Alt-F11 to launch Visual Basic Editor.
- Insert a standard module.
- Paste code.
- From Tools menu click "Reference".
- Set a reference to Microsoft Internet Controls (shdocvw.dll).
- Set a reference to Microsoft HTML Object Library (mshtml.dll).
- Update the constant in the code to a valid username and password.
- From the debug menu click compile.
- Run.
|
Test the code:
|
- Update the constant in the code to a valid username and password.
- From the debug menu click compile.
- Run.
|
Sample File:
|
IE_Example.zip 13.3KB
|
Approved by mdmackillop
|
This entry has been viewed 237 times.
|
|