Hello all,
I am trying to learn how to change the google search query with-in VB6 ,
in this search it is obvious that it is searching the word frog
i would like to know how to use a textbox as the souce of the query.
Sub Command1_click()
shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE
http://www.google.com.au/search?hl=en&q=frog&meta="
End Sub
Thankyou for any help it will be much appreciated.
Gobblegob.
9 4644
You need to capture all the individual word separately from user input. Then run the query using like search after eleminating unnecessary word.
You need to capture all the individual word separately from user input. Then run the query using like search after eleminating unnecessary word.
Thanks for your reply but umm... i dont know how to do it, im after an example to learn from.
Thanks
Gobblegob.
Hi,
It is easy if you are using a Webrowser Control,
say, you want to search for VB6 and DataGrid:
Write this Code in CommandSearch_Click event -
WebBrowser1.Navigate2 "http://www.google.co.in/search?hl=en&q=VB6+DATAGRID&meta="
-
DoEvents
-
Regards
Veena
Hi,
It is easy if you are using a Webrowser Control,
say, you want to search for VB6 and DataGrid:
Write this Code in CommandSearch_Click event -
WebBrowser1.Navigate2 "http://www.google.co.in/search?hl=en&q=VB6+DATAGRID&meta="
-
DoEvents
-
Regards
Veena
Thanks but i understand that im trying to use a textbox as the search input on the VB6 form
Thanks
Gobblegob.
Hi,
OK, Say you have to search from textbox Text1
use this Code: -
Dim TArr
-
Dim TempStr As String
-
Dim i As Integer
-
TArr = Split(UCase(Text1.Text)," ")
-
TempStr = "="
-
For i = LBound(TArr) To UBound(TArr)
-
If Trim(TArr(i)) <> "" Then
-
If i = UBound(TArr) Then
-
TempStr =TempStr TArr(i)
-
Else
-
TempStr =TempStr TArr(i) & "+"
-
End If
-
End If
-
Next
-
TempStr = "http://www.google.co.in/search?hl=en&q" & TempStr & "&meta="
-
WebBrowser1.Navigate2 TempStr
-
DoEvents
-
Refine the code..
Regards
Veena
Hi,
OK, Say you have to search from textbox Text1
use this Code: -
Dim TArr
-
Dim TempStr As String
-
Dim i As Integer
-
TArr = Split(UCase(Text1.Text)," ")
-
TempStr = "="
-
For i = LBound(TArr) To UBound(TArr)
-
If Trim(TArr(i)) <> "" Then
-
If i = UBound(TArr) Then
-
TempStr =TempStr TArr(i)
-
Else
-
TempStr =TempStr TArr(i) & "+"
-
End If
-
End If
-
Next
-
TempStr = "http://www.google.co.in/search?hl=en&q" & TempStr & "&meta="
-
WebBrowser1.Navigate2 TempStr
-
DoEvents
-
Refine the code..
Regards
Veena
Thanks for your post Veena,
but i am getting a syntax error on TempStr =TempStr TArr(i)
Else TempStr =TempStr TArr(i) & "+"
i've looked at it over and over but i cant see why if , if you wouldnt mind talkin me through it i would be very greatfull.
Thanks ,
Gobblegob.
Thanks for your post Veena,
but i am getting a syntax error on TempStr =TempStr TArr(i)
Else TempStr =TempStr TArr(i) & "+"
i've looked at it over and over but i cant see why if , if you wouldnt mind talkin me through it i would be very greatfull.
Thanks ,
Gobblegob.
I worked it out all i used is this:
Dim TempStr As String
Dim TempText As String
TempText$ = Text1.Text
TempStr = "http://www.google.com.au/search?hl=en&q" & "=" & TempText & "&meta="
WebBrowser1.Navigate2 TempStr
Thanks for your help,
Gobblegob.
This is easy:
Create a text box named Textbox1
Create a web browser named webbrowser1
Create a button called Button1. This will be your "Search" button.
Copy this code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim search As String = TextBox1.Text
WebBrowser1.Navigate ("www.google.com.au/search?hl=en&q=" + search + "&meta=")
End Sub
Easy as that!
In VBA. - Sub Main()
-
Dim IE As Object, web_site As String
-
-
web_site = "http://www.google.com"
-
-
Set IE = CreateObject("InternetExplorer.Application")
-
-
With IE
-
.Visible = True
-
.Navigate web_site
-
End With
-
-
Call Wait(IE)
-
-
IE.Document.All("q").Value = "Test"
-
IE.Document.All("btnG").Click
-
-
Call Wait(IE)
-
End Sub
-
-
Private Sub Wait(IE As Object)
-
While IE.Busy
-
DoEvents
-
Wend
-
-
While IE.Document.ReadyState <> "complete"
-
DoEvents
-
Wend
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Fred |
last post by:
I have read and tried every combination for hours. I'm sorry, but I
don't get it. How do I have a form with textboxes and buttons and
allow click events to execute a server function then display...
|
by: EMala |
last post by:
Hello everybody!
I have a problem and I dont find a answer...
Please help me.
I have a application, that the user log in the app, get a
usersessionID, and buy the products on my virtual mall.....
|
by: Alastair |
last post by:
Hello guys,
I've been building a search facility for an intranet site I'm part of
developing and we've been building a search engine using Index Server.
It mostly works, however there have been...
|
by: Chris |
last post by:
I have yet to understand or get a response on the issue I'm having.
I'm taking an asp web application and migrating it from Windows 2K to 2003.
I have the new website location (2003) settings...
|
by: Angelos |
last post by:
Does anyone knows how to execute a PHP function using javascript..
What I want is to do that in the line bellow:
<a href="" target="_blank" onClick="<? add_product_category(); ?>" >add...
|
by: jm |
last post by:
I have a parent window:
<script language="javascript">
function doSearch() {
result=showModalDialog("searchmni.aspx?lastname=smith");
alert(result);
}
</script>
|
by: Mark |
last post by:
I'd like to execute some code on the cleint when the user hits Enter key
in a dropdown box. Another words, the user selects an item from the combo
and then hits Enter key. I want to attach code to...
|
by: Rajiv Gupta |
last post by:
Hi,
We are moving from asp to asp.net.
In our existing model we execute the asp by including them in .html
files.
For example:
In abc.html file we include following directive:
<!--exec...
|
by: JIM.H. |
last post by:
Hello,
Is there any difference to between SLQ string in the code and call execute
query and call a stored procedure and execute the query that way concerning
speed, effectiveness, reliability,...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |