?
Solved

Clicking a button within HTML page

Posted on 2004-04-22
11
Medium Priority
?
255 Views
Last Modified: 2010-05-02
I have the handle to the class: "Internet Explorer_Server"

I don't know if it will help, but I want to be able to get my application to find an edit within a webpage, type some text in it and then click a button with "Search" as its caption on the web page.

Is this possible? And how would I go about doing this?

Thanks
0
Comment
Question by:PhilAI
  • 5
  • 2
  • 2
  • +2
11 Comments
 
LVL 11

Expert Comment

by:bingie
ID: 10894689
What is the URL of the page where the button is?
0
 
LVL 2

Expert Comment

by:gimmeadrink
ID: 10895168
This question was answered here:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20962877.html by Aelatik

Hope this helps
0
 
LVL 11

Expert Comment

by:bingie
ID: 10895182
Some ways to do this,

Without components or references (example, thanks to ZZZZZOC):

Private Sub Form_Load()
    Dim oIE As Object, sURL As String
    sURL = "http://login.passport.net/uilogin.srf?id=2"
    Set oIE = CreateObject("InternetExplorer.Application")
    oIE.Visible = True
    Call oIE.Navigate("www.hotmail.com")
    Do Until oIE.LocationURL = sURL And oIE.readystate = 4
        DoEvents
    Loop
    oIE.document.Form1.login.Value = "email@email.com"  'replace with your id
    oIE.document.Form1.passwd.Value = "pass"  'replace with your password
    oIE.document.Form1.submit1.Click
End Sub

Or With the webbrowser component:

Webbrowser1.Document.All("Login").Click

If you want to provide the URL, it would help.

Bingie
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:gimmeadrink
ID: 10895195
yeah, i think that was the same question, but for some reason, its not going to be the one that gets accepted...
heh, whatever works i guess.
0
 
LVL 5

Expert Comment

by:amit1978
ID: 10897169
looking for same
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10900331
Not got the address with me here, so I'll let you guys know when I have finished work what the address is.

It is not a search button, but the 'Place Bid' I want now, decided I didn't need the search function. I want to be able to automatically place bids on eBay. So, the address depends on the item number - just pick any item on the UK eBay website as an example, and that would be feasible.

Thanks all!
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10900344
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10902271
OK, is it possible to navigate through the page when it is in IEXPLORE.EXE

i.e. I have the page open in the browser, and want to connect to that instance?
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10902350
OK, I have found out that this can do it, but what if I want a specific window?

If IEeBayItem Is Nothing Then Set IEeBayItem = GetObject(, "InternetExplorer.Application")

I may have more than one MS IE window open at a time...
0
 
LVL 14

Accepted Solution

by:
aelatik earned 500 total points
ID: 10906434
You can loop trhough all IE instances and connect to the one you like with this code :

    Dim IE, WIN
    Set IE = CreateObject("internetexplorer.application")
    Set WIN = CreateObject("shell.application")
    For Each IE In WIN.Windows
        ' check if this is the URL you want
        If InStr(1, IE.document.Title, "eBay", vbTextCompare) > 0 Then
            ' Do your stuff with IE. this is the instance you need.
        End If
    Next IE
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10907037
Spot on aelatik! I knew what I wanted to do, just didn't know how exactly.

Thanks for all your help.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

864 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