I have embedded a Moz control in my VB6 application. I would like to
programmatically load a page and print it (without user intervention).
However, whenever I try to print, I get the following error: "Method
'ExecWB' of object 'IWebBrowser2' failed". I've noticed a lot of other
people complaining about this problem but haven't seen any solutions.
It's interesting to note that I *can* print if I have TWO buttons that
a user clicks - one to navigate and one to print. If there is only one
button to do both, printing fails with the same error. I tried put a
delay in between navigating and printing but that didn't seem to make
a difference in my (single-threaded) application. It's also
interesting to note that the 2-button method works only when I run
from a compiled version of the software - if I try to run it from
within the VB debugger (and I use that term loosely) it fails again
with the same error.
Anyone have any experience with this or ideas? Thank you for time,
I've been trying unsuccessfully to get this to work for a while now.
sample code:
MozillaBrowser1.Navigate2 ("file:///F:/file.html")
MozillaBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,
"", ""
Thanks!
John