rjef
asked on
Google Seach Box via vb6 ie control
why doesn't this work.? see attachment
Option Explicit
Dim WithEvents IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Visible = True
IE.Navigate2 "www.google.com"
MsgBox ""
IE.document.getElementById ("q").Valu e = "TEST"
End Sub
Google-Seach-Box-via-vb-ie-control.jpg
Option Explicit
Dim WithEvents IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Visible = True
IE.Navigate2 "www.google.com"
MsgBox ""
IE.document.getElementById
End Sub
Google-Seach-Box-via-vb-ie-control.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The search terms input has the name "q", but not the id.
So you'd have to find a different way to obtain a reference to that element, because this won't.
<input name="q" ...
So you'd have to find a different way to obtain a reference to that element, because this won't.
IE.document.getElementById("q").Value = "TEST"
ASKER
thanks
You’re welcome and I’m glad I was able to help.
If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Top Expert Visual Basic Classic 2012 to 2018
Experts Exchange Top Expert VBA 2018
Experts Exchange Distinguished Expert in Excel 2018
If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Top Expert Visual Basic Classic 2012 to 2018
Experts Exchange Top Expert VBA 2018
Experts Exchange Distinguished Expert in Excel 2018
you need to tell google that you want to search and add what you want to search for
https://www.google.com/search?q=test