Solved

Post Search

Posted on 2006-06-12
2
163 Views
Last Modified: 2010-04-30
I have a vendor website that I want to open a search for automatically. I have the web address (http://www.server.com/search.asp) and I have the textfield that needs to be posted (search_text). I want to know how I can press a button in my VB6 app, and it will open IE, go to that search page, and POST the search text so that' their asp page will run the search and return the results.

Thanks in advance.
0
Comment
Question by:DrDamnit
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 16887653
Click on Project --> References and check the "Microsoft Internet Controls" entry.

Option Explicit
 
Private submitted As Boolean
Private WithEvents IE As InternetExplorer

Private Sub Command1_Click()
    If IE Is Nothing Then
        Set IE = CreateObject("InternetExplorer.Application")
        IE.Visible = True
    End If
    submitted = False
    IE.Navigate "http://www.server.com/search.asp"
End Sub

Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    If Not submitted Then
        IE.Document.All.Item("q").Value = "Idle_Mind Experts Exchange"
        IE.Document.All("sa").Click
        submitted = True
    End If
End Sub

Private Sub IE_OnQuit()
    Set IE = Nothing
End Sub
0
 
LVL 32

Author Comment

by:DrDamnit
ID: 16907864
This is how to automatically fill in a form and hit submit. I want to send data directly to the processing .asp file. Like we do with CURL in PHP.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

707 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

16 Experts available now in Live!

Get 1:1 Help Now