Searching web sites using VBA - possible?

E

Ed

I have a list of web sites down a table column. These are all web-based
suppliers
for specialty products. I'd like to be able to put one or more key words
into a UserForm and have a macro iterate down the list, performing a search
of each site for the product. Kind of like limiting Google/Froogle to a few
chosen sites.

I am passably competent in VBA. I know nothing about web sites, except that
they can contain many pages. Is what I have described do-able through VBA?

Ed
 
A

Anand.V.V.N

Hi Ed,
Using the activedocument.followhyperlink you can do what you want.
You can write a loop in which you access the table cell data, using
followhyperlink method you can pass the search string.

Is this what you were lookign for?
I hope it works.
 
E

Ed

I set that up real quick and got a run-time error 432: "File name or class
name not found during Automation operation." Any suggestions?
Ed
 
J

Jean-Guy Marcil

Ed was telling us:
Ed nous racontait que :
All I had was:

Dim strLink As String
strLink = "www.tmyers.com"

ActiveDocument.FollowHyperlink _
Address:=strLink, _
NewWindow:=True

You need to specify the type of protocol:

Const strLink As String = "http://www.tmyers.com"

ActiveDocument.FollowHyperlink _
Address:=strLink, _
NewWindow:=True


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
E

Ed

Thank you, Jean-Guy! The link now works. Now I wonder if the rest of what
I desire is also possible. From my original post:
-------------
I have a list of web sites down a table column. These are all web-based
suppliers
for specialty products. I'd like to be able to put one or more key words
into a UserForm and have a macro iterate down the list, performing a search
of each site for the product. Kind of like limiting Google/Froogle to a few
chosen sites.

I am passably competent in VBA. I know nothing about web sites, except that
they can contain many pages. Is what I have described do-able through VBA?
---------------

I can do the UserForm and pass the inputs into strings to use in the code.
But can I make a search of an entire web site through VBA like this? Or
will it take a much greater understanding of VBA and / or web sites to do
this? What do you think?

Ed
 
J

Jean-Guy Marcil

Ed was telling us:
Ed nous racontait que :
Thank you, Jean-Guy! The link now works. Now I wonder if the rest
of what I desire is also possible. From my original post:
-------------
I have a list of web sites down a table column. These are all
web-based suppliers
for specialty products. I'd like to be able to put one or more key
words into a UserForm and have a macro iterate down the list,
performing a search of each site for the product. Kind of like
limiting Google/Froogle to a few chosen sites.

I am passably competent in VBA. I know nothing about web sites,
except that they can contain many pages. Is what I have described
do-able through VBA? ---------------

I can do the UserForm and pass the inputs into strings to use in the
code. But can I make a search of an entire web site through VBA like
this? Or will it take a much greater understanding of VBA and / or
web sites to do this? What do you think?

I am not an expert in manipulating web sites programmatically, but I do not
think you can manipulate a Web site (like searching it) through the Word
Object Model. You may have to go through scripting or the IE Object Model.

Try posting in one of the IE newsgroups like
microsoft.public.windows.inetexplorer.ie5.programming
microsoft.public.windows.inetexplorer.ie55.programming.general
etc.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
E

Ed

I will go there. Thank you for all your help.
Ed

Jean-Guy Marcil said:
Ed was telling us:
Ed nous racontait que :


I am not an expert in manipulating web sites programmatically, but I do not
think you can manipulate a Web site (like searching it) through the Word
Object Model. You may have to go through scripting or the IE Object Model.

Try posting in one of the IE newsgroups like
microsoft.public.windows.inetexplorer.ie5.programming
microsoft.public.windows.inetexplorer.ie55.programming.general
etc.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top