Solved

Submit button in webbrowser - VISUAL BASIC 6

Posted on 2012-03-14
5
1,321 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 45

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
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…

705 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

18 Experts available now in Live!

Get 1:1 Help Now