?
Solved

Implementing "Find on this page" in WebBrowser

Posted on 2000-05-08
6
Medium Priority
?
857 Views
Last Modified: 2012-06-21
I need to implement the "Find on this page" dialog for the WebBrowser control. I have tried the following, and neither works correctly:

First, I tried sendkeys:
   Me.WebBrowser1.SetFocus
   SendKeys "^F"

This worked for a while, but I had to implement an interface to trap the right click on the menu. Doesn't seem to work anymore.

Second, I tried the ExecWB method. However, this method brings up the Find File method instead.
ActiveForm.WebBrowser1.ExecWB OLECMDID_FIND, OLECMDEXECOPT_DONTPROMPTUSER

Bonus points if you can indicate how to implement "Find Next (F3)" functionality...

0
Comment
Question by:AZWolf7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2789807
i think trying to find a way to use sendkeys is your best bet...let ie take care of using it...another expert and myself have been attempting to show the find and/or replace dialog ourselves through code but we can't keep it from crashing our programs. there are several pieces of code in C that show how to do it but we have been unable to duplicate it in vb.
0
 

Author Comment

by:AZWolf7
ID: 2789840
I have some C++ code which used the IOleCommand interface, but alas, can't seem to implement it. If I do find it, I'll post it here.
0
 
LVL 14

Accepted Solution

by:
mcrider earned 300 total points
ID: 2790943
This works every time for me...

   WebBrowser1.SetFocus
   SendKeys "^f", True


You MUST send the ^f as lowercase... ^F doesn't work.


Cheers!®©
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:AZWolf7
ID: 2793183
Still didn't take care of all the problems when you implement IDocHostUIHandler, but such a simple solution that works! I guess it is the simeple things that gey ya.. *grin*
thanks!
0
 

Author Comment

by:AZWolf7
ID: 2793185
Still didn't take care of all the problems when you implement IDocHostUIHandler, but such a simple solution that works! I guess it is the simeple things that get ya.. *grin*
thanks!
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2794642
Thanks for the points! Gladd I could help!


Cheers!®©
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question