Solved

Submit button in webbrowser - VISUAL BASIC 6

Posted on 2012-03-14
5
1,481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 48

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

718 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