Solved

Using IHTMLFormElement

Posted on 2004-03-25
3
465 Views
Last Modified: 2008-03-04
Can anyone give me an example of how to use VB to:
1.) Navigate the browser to a web page that contains a form
2.) Populate the form
3.) Submit the form

Thanks!
0
Comment
Question by:AmyL
  • 3
3 Comments
 
LVL 27

Accepted Solution

by:
Ark earned 500 total points
ID: 10684925
  Dim ie As Object
   On Error Resume Next
   Set ie = CreateObject("InternetExplorer.Application")
   ie.Navigate strURL
      While ie.ReadyState < 4
      DoEvents
   Wend
'  ie.Visible = True
   ie.Document.All("UserName").Value = "MyName"  
   ie.Document.All("Password").Value = "MyPassword"  
   ie.Document.All("Submit").Click
0
 
LVL 27

Expert Comment

by:Ark
ID: 10684959
This is a test from VB
0
 
LVL 27

Expert Comment

by:Ark
ID: 10684968
PS above post was a test of following code:

Private Sub Command1_Click()
   Dim ie As Object
   On Error Resume Next
   Set ie = CreateObject("InternetExplorer.Application")
   ie.Navigate "http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20932909.html"
      While ie.ReadyState < 4
      DoEvents
   Wend
   ie.Visible = True
   ie.Document.All("body").Value = "This is a test from VB"
   ie.Document.All("Submit").Click
End Sub
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now