473,837 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

I'm trying to print an HTML file using AxWebBrowser.Ex ecWB 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.Q ueryStatusWB(SH DocVw.OLECMDID. OLECMDID_PRINT) ;
object o = "";
SHDocVw.OLECMDI D Print = SHDocVw.OLECMDI D.OLECMDID_PRIN T;
SHDocVw.OLECMDE XECOPT PromptUser = SHDocVw.OLECMDE XECOPT.OLECMDEX ECOPT_PROMPTUSE R;
axWebBrowser1.E xecWB(Print, DontPromptUser, ref o, ref o);

Thanks.

Jul 21 '05 #1
1 6079
Use the IOleCommandTarg et 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****@discuss ions.microsoft. com> wrote in message
news:9A******** *************** ***********@mic rosoft.com...
I'm trying to print an HTML file using AxWebBrowser.Ex ecWB 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.Q ueryStatusWB(SH DocVw.OLECMDID. OLECMDID_PRINT) ;
object o = "";
SHDocVw.OLECMDI D Print = SHDocVw.OLECMDI D.OLECMDID_PRIN T;
SHDocVw.OLECMDE XECOPT PromptUser = SHDocVw.OLECMDE XECOPT.OLECMDEX ECOPT_PROMPTUSE R; axWebBrowser1.E xecWB(Print, DontPromptUser, ref o, ref o);

Thanks.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2647
by: Rob McLennan - ZETLAND | last post by:
Hi, I'm relatively clueless when it comes to correct ASP syntax. I'm testing out a search form for my company's website which is done in ASP. The results are displayed as per the code shown at the very bottom of this message. All I want to do is add a target="top" to the URL which is displayed as a link at the top of the results. I know enough about html to know that it probably goes somewhere into the follwing section: <a href=""" &...
6
77518
by: Tony Marston | last post by:
The code <a href="..." target="_blank">...</a> will not validate as XHTML STRICT because of the 'target' tag, so how do I achieve the same result by moving it to a CSS file? I cannot find anything which allows me to specify 'target=' on an anchor tag. -- Tony Marston http://www.tonymarston.net
5
6531
by: SirPoonga | last post by:
I think I'd have to do a combination of ASP and javascript to do this. What I want to do fill the first drop down box with values from a database query. Then based off that selection fill in the values of another drop down. Let's use the car industry as an example. Lets say I am storing in a database the data and relationships between car make, car type, and car model. So the first drop down box would like all makes. Upon selecting...
10
60735
by: Dieter Salath? | last post by:
Hi, in our webpage, a user could open a windows explorer to his temp directory with a simple link and usage of the file protocol: <a href="file://C:\temp" target="_blank">C:\temp</a> This worked very well a long time, but now it does not work anymore. We use IE6 and Microsoft Windows XP Professional 2002 SP2. I guess it has something to do with new IE security features. Does
2
7070
by: Alanoly J. Andrews | last post by:
Hi, I have two tables (that I know of) in a database that seem to be corrupted. All SQL statements on the tables hang, "select * from..", "select count (*) from", "delete from..". I can't even drop the tables as the "drop table..." statement, too, hangs. But the tables do exist as they show up in "describe table <tabname> ". A "create table" statement fails saying that the table already exists.
10
2180
by: Abel | last post by:
I have this code string theClassName = "Rules.FillListBox.FillListBox" + theType + ", Rules" Type theClass = Type.GetType(theClassName) Object o = Activator.CreateInstance(theClass) object parameters = new object parameters = elListBox parameters = (IList)Session theClass.GetMethod("fill").Invoke(o, (object)parameters)
1
401
by: jgctr4 | last post by:
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,...
2
1661
by: Chris Marsh | last post by:
All We have a requirement to add a "target" attribute with a value of "_parent" to any links in a given .aspx page, UNLESS a target has already been specified for that link. We are not in control of content, the page in question is referenced from an iframe, and we need any links from this page to open in the browser window rather than the iframe. We already have a Response filter in operation which replaces a token with a specified URL...
2
3016
by: myquestion | last post by:
how to hide/show a text box using drop downlist in php
0
9833
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10617
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7803
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6989
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5666
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5842
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4469
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3122
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.