rbend
asked on
How to "find on this page" inside a MSBrowser control
I am displaying a text page using a MSInternet Control (browser).
What code will allow me to search the page for the occurance of a string and scroll the page to that point?
What code will allow me to search the page for the occurance of a string and scroll the page to that point?
hearing...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<ping>
Would SendKeys("^F") (CTRL-F) do what you are after?
anthony_glenwright, nice and simple and works too!
It is matter of opinions, but to me, sendkeys is a "last resort".
Your comment has very good advantages: no create objects, don't waste resources, it's clever indeed.
Anyway, you need put others sendkeys to set text to search and push the search button.
Cheers
It is matter of opinions, but to me, sendkeys is a "last resort".
Your comment has very good advantages: no create objects, don't waste resources, it's clever indeed.
Anyway, you need put others sendkeys to set text to search and push the search button.
Cheers
I agree about the sendkeys :-)
Here's a more elegant way
wbrDisplay.ExecWB OLECMDID_SHOWFIND, OLECMDEXECOPT_PROMPTUSER
Here's a more elegant way
wbrDisplay.ExecWB OLECMDID_SHOWFIND, OLECMDEXECOPT_PROMPTUSER
Oops, my bad. The webbrowser control does not support OLECMDID_SHOWFIND - ref: http://support.microsoft.com/support/kb/articles/Q251/1/33.ASP
ASKER
Richie:
I found the Microsoft HTML Object Library in the componants list and added it to the project but I still get "object required" on the line
"Set ieDoc = web1.Document"
Do I have to add a module with something in it or what?
I found the Microsoft HTML Object Library in the componants list and added it to the project but I still get "object required" on the line
"Set ieDoc = web1.Document"
Do I have to add a module with something in it or what?
ASKER
Richie:
I found the Microsoft HTML Object Library in the componants list and added it to the project but I still get "object required" on the line
"Set ieDoc = web1.Document"
Do I have to add a module with something in it or what?
I found the Microsoft HTML Object Library in the componants list and added it to the project but I still get "object required" on the line
"Set ieDoc = web1.Document"
Do I have to add a module with something in it or what?
ASKER
Sorry...found my error.
Great answer...
bb
Great answer...
bb
Thanks!
I would like to say that Anthony's solution was a valid one.
It is a pity that OLECMDID_SHOWFIND doesn't works. I like that approach more than mine!
Cheers
I would like to say that Anthony's solution was a valid one.
It is a pity that OLECMDID_SHOWFIND doesn't works. I like that approach more than mine!
Cheers