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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.OLECMDID_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.
 
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 said:
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?
 
Back
Top