Link to home
Start Free TrialLog in
Avatar of amtate
amtate

asked on

Stop WebBrowser MessageBoxes

Hi,

Does anyone know how to stop the "Do you want to allow.."  MessageBoxes appearing whenever you use 'cut', 'copy' & paste with the WebBrowser control?

For example, I'm allowing the user to paste content from the Clipboard directly into the control, though when you click the menu option, you get an annoying "Do you want to allow this page to paste information from your clipboard?" message.

I'm using the following code:

   webBrowser1.ExecWB OLECMDID_PASTE, OLECMDEXECOPT_DONTPROMPTUSER

Can this message be suppressed, as I can't seem to find a property to achieve this?
Avatar of edwardiii
edwardiii

Howdy.

I'm able to paste images and/or text by putting your code into a command button's click event.  Are you referring to the menu accessed by right-clicking on the WebBrowser document?
I'm not sure what prompts the error you're getting.  Possibly "WebBrowser1.Silent" and/or On Error Resume Next will help.  If not, allowing users to complete a paste operation as I detailed above may be a workaround.
Avatar of amtate

ASKER

Hi,

This is being done from within a click event - in this case from a ToolBar button...

If I set WebBrowser.Silent = True - it does stop the messages, though unfortunately it also stops the paste event from happening!

Is putting the paste event in a comment button an option?
Avatar of amtate

ASKER

not sure what you mean here?
Avatar of amtate

ASKER

Incidentally, If I use the right-click context menu to cut; copy paste etc - I don't get any prompt messages...
ASKER CERTIFIED SOLUTION
Avatar of edwardiii
edwardiii

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry--please replace the quoted expression from:

    When you try to paste into the WebBrowser control by clicking one of the menu options, you're getting the pop-up message "webBrowser1.ExecWB OLECMDID_PASTE, OLECMDEXECOPT_DONTPROMPTUSER", is that right?

with

"Do you want to allow.."