Solved

Clicking a button within HTML page

Posted on 2004-04-22
11
250 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
[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
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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 125 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 88
I need help formating a date variable in my VB.Net application 2 68
Help me. 3 70
Set email body to html using vbscript 6 71
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

733 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