469,649 Members | 1,202 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

printing using ExecWB gives error "Trying to revoke drop target ..

I'm trying to print an HTML file using AxWebBrowser.ExecWB but it it gives a run time error "Trying to revoke a drop target that has not been registered". Does anyone have any suggestions?

axWebBrowser1.QueryStatusWB(SHDocVw.OLECMDID.OLECM DID_PRINT);
object o = "";
SHDocVw.OLECMDID Print = SHDocVw.OLECMDID.OLECMDID_PRINT;
SHDocVw.OLECMDEXECOPT PromptUser = SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER;
axWebBrowser1.ExecWB(Print, DontPromptUser, ref o, ref o);

Thanks.

Jul 21 '05 #1
1 5703
Use the IOleCommandTarget interface on the document, rather than the browser
itself, and call the Exec method.

Also, don't call QueryStatus beforehand as the WebBrowser control frequently
denies that it implements a command when it actually does (this is a flaw in
the interop).

HTH

Charles
"jgctr4" <jg****@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
I'm trying to print an HTML file using AxWebBrowser.ExecWB but it it gives a run time error "Trying to revoke a drop target that has not been
registered". Does anyone have any suggestions?
axWebBrowser1.QueryStatusWB(SHDocVw.OLECMDID.OLECM DID_PRINT);
object o = "";
SHDocVw.OLECMDID Print = SHDocVw.OLECMDID.OLECMDID_PRINT;
SHDocVw.OLECMDEXECOPT PromptUser = SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER; axWebBrowser1.ExecWB(Print, DontPromptUser, ref o, ref o);

Thanks.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rob McLennan - ZETLAND | last post: by
2 posts views Thread by Alanoly J. Andrews | last post: by
2 posts views Thread by Chris Marsh | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.