Solved

Submit button in webbrowser - VISUAL BASIC 6

Posted on 2012-03-14
5
1,364 Views
Last Modified: 2012-04-11
Hello, i want to automate the process of submitting a form within the webbrowser1 in my visual basic project.

I want a code which will do something like this,

If a submit button exist on the page with the Value of "Send" or "Submit" then submit that button.

So far i have this,

WebBrowser1.Document.All("submit").Click

Thank you
0
Comment
Question by:SDfatha
  • 3
5 Comments
 
LVL 17

Expert Comment

by:vb_elmar
ID: 37720434
The following sample scans the web page for all input elements.

If the input element has the Value of "Send" or "Submit" it will be clicked.
3.zip
0
 
LVL 17

Accepted Solution

by:
vb_elmar earned 500 total points
ID: 37724690
Private Sub Command2_Click()

For Each virtualButton In WebBrowser1.Document.getElementsByTagName("input")

If virtualButton.Type = "submit" Then
      isSUBMIT = virtualButton.Value = "Send" Or virtualButton.Value = "Submit"
      If isSUBMIT = True Then virtualButton.Click: Exit For
End If

Next virtualButton

End Sub
0
 
LVL 17

Expert Comment

by:vb_elmar
ID: 37726993
Today the webmaster of fastemailsender has changed the caption of the "Send" button,

The caption of the "Send" button is now "Send message".
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 37831670
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 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