473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

webrowser control

Hi,

I posted an earilier post vb6 and shellexecute to accomplish my task but think this is better with the webrowser control.

I have to do a search with vb6 and somehow open up the third url on the search page.

On the form there is

textbox = search criteria
command button search
combobox = search engines listed (Google,MSN,Altavista)
webbrowser to hold the page.



I have never worked with this control and can't seem to figure out how to enter the search text, select the search engine click the show url button and have the third url on the search page to open up that web site.

CODE IS BELOW:

Private Sub Command1_Click()
If Text1.Text <> "" And Combo1.Text <> "SELECT ONE" Then
Select Case Combo1.Text


'holdstring = ShellExecute(0&, "open", "http://www.google.co.uk/search?as_q=dogs&hl=en&rlz=1T4GGLJ_en-GBGB232GB233&num=1&start=2", "", vbNullString, 1)
Case "ALTAVISTA"
URLTOSEARCH = "http://www.altavista.com/web/results?itag=ody&pg=aq&aqmode=s&aqa=" & Text1.Text & "&aqp=&aqo=&aqn=&kgs=1&kls=0&dt=tmperiod&d2=0&dfr% 5Bd%5D=1&dfr%5Bm%5D=1&dfr%5By%5D=1980&dto%5Bd%5D=1 5&dto%5Bm%5D=8&dto%5By%5D=2007&filetype=&rc=dmn&sw d=&lh=1&nbq=3"
Case "GOOGLE"

URLTOSEARCH = "http://www.google.co.uk/search?as_q= " & Text1.Text & "&hl=en&rlz=1T4GGLJ_en-GBGB232GB233&num=1&start=2&btnG=Google+Search&as_e pq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr= all&as_occt=any&as_dt=i&as_sitesearch=&as_rights=& safe=images"

Case "MSN"

URLTOSEARCH = "http://search.live.com/results.aspx?q=" & Text1.Text & "&mkt=en-us&FORM=LIVSOP&go.x=1&go.y=3"


End Select

Else
MsgBox "PLEASE SELECT YOUR SEARCH AND ENTER SEARCH CRITERIA"
End If



WebBrowser1.Navigate (URLTOSEARCH)
Dim Doc As HTMLDocument
Set Doc = WebBrowser1.Document

***** THIS IS WHERE I WENT THROUGH THE LINKS ON THE SEARCH PAGE ***********THAT WAS LOADED BY ,WebBrowser1.Navigate ******************(URLTOSEARCH)
Dim i As Integer
THETOTAL = WebBrowser1.Document.links.length
For i = 0 To THETOTAL

MsgBox WebBrowser1.Doc.links(i).href & i

Next

End Sub

I don't need the search page to be loaded, somehow the third url sites is what is to open.

If anybody has any ideas that would be greatly appreciated.

Thanks,
SB
Aug 17 '07 #1
0 1078

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Todd | last post by:
I am trying to imbed the IE web browser control in my application. I want to sit on the text input fields on the web page and recieve keyup/keydown events. These events are not getting back to...
1
by: mike.hodgson | last post by:
Hi, I have an image in a webrowser which is 3000 pixels wide so does not fit in the browsers window. It is a CAD drawing so needs this detail. Using the scroll bars makes the image difficult to...
6
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get...
1
by: Chase Gale | last post by:
Hello, I am developing a large financial application... In a section of the app I host a Microsoft Webbrowser control which connects to a bank and displays thier Java Applet. The problem I am...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
0
by: kamimeer | last post by:
I am using .net 2.0 and WebBrowser control that comes with it in C#.I am having some issue trying to do a POST action on a Web URL. I have a site that has two input fields in it, but when I try to...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
1
by: DICKDDD | last post by:
The problem is that if you navigate the control to a page containg a flash swf object, the object will play once (suppose it has a button to do that). After it plays once it wont play again. Same...
4
by: jim | last post by:
I want to make a WYSIWYG editor for HTML pages that can detect events in the webbrowser control in real time and control the webbrowser control (and internal documents) to allow simple stuff like...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.