471,119 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

How does one *PROPERLY* print rendered HTML?

I tried using
webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER)

but it returns asynchronously. Is there anyway I can know when the document
has finished printing when using webBrowser.ExecWB ?

I also tried using rundll32.exe with mshtml.dll but again it displays a
dialog. So my question to that is, how do I print using rundll32.exe w/
mshtml but not have it display the print confirmation dialog.

I tried using onlyconnect.HtmlEditor but when I use LoadDocument, and pass
in the full path of a html file located in the temporary files folder, I
get:
An unhandled exception of type 'onlyconnect.HtmlEditorException' occurred in
htmleditor.dll
Additional information: Document not created
Jul 21 '05 #1
3 4138
I guess I'll just have to call webBrowser.ExecWB and call
Application.DoEvents in a loop for 30 afterwards sec to make sure it was
sent to the spooler.
"Hasani" <bi*******@hax0r.dyndns.org> wrote in message
news:O8**************@TK2MSFTNGP09.phx.gbl...
I tried using
webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER)

but it returns asynchronously. Is there anyway I can know when the document has finished printing when using webBrowser.ExecWB ?

I also tried using rundll32.exe with mshtml.dll but again it displays a
dialog. So my question to that is, how do I print using rundll32.exe w/
mshtml but not have it display the print confirmation dialog.

I tried using onlyconnect.HtmlEditor but when I use LoadDocument, and pass
in the full path of a html file located in the temporary files folder, I
get:
An unhandled exception of type 'onlyconnect.HtmlEditorException' occurred in htmleditor.dll
Additional information: Document not created

Jul 21 '05 #2
Why loop?
Just look at the printer's spool.

"Hasani" <HJ****@hotmail.c0m> wrote in message
news:Bz**********************@twister.nyc.rr.com.. .
I guess I'll just have to call webBrowser.ExecWB and call
Application.DoEvents in a loop for 30 afterwards sec to make sure it was
sent to the spooler.
"Hasani" <bi*******@hax0r.dyndns.org> wrote in message
news:O8**************@TK2MSFTNGP09.phx.gbl...
I tried using
webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER)

but it returns asynchronously. Is there anyway I can know when the document
has finished printing when using webBrowser.ExecWB ?

I also tried using rundll32.exe with mshtml.dll but again it displays a
dialog. So my question to that is, how do I print using rundll32.exe w/
mshtml but not have it display the print confirmation dialog.

I tried using onlyconnect.HtmlEditor but when I use LoadDocument, and pass in the full path of a html file located in the temporary files folder, I
get:
An unhandled exception of type 'onlyconnect.HtmlEditorException'

occurred in
htmleditor.dll
Additional information: Document not created


Jul 21 '05 #3
I would but it truncates the path when it's longer than 63 characters.
"Ayende Rahien" <Ay****@no.spam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Why loop?
Just look at the printer's spool.

"Hasani" <HJ****@hotmail.c0m> wrote in message
news:Bz**********************@twister.nyc.rr.com.. .
I guess I'll just have to call webBrowser.ExecWB and call
Application.DoEvents in a loop for 30 afterwards sec to make sure it was
sent to the spooler.
"Hasani" <bi*******@hax0r.dyndns.org> wrote in message
news:O8**************@TK2MSFTNGP09.phx.gbl...
I tried using
webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER)

but it returns asynchronously. Is there anyway I can know when the

document
has finished printing when using webBrowser.ExecWB ?

I also tried using rundll32.exe with mshtml.dll but again it displays a dialog. So my question to that is, how do I print using rundll32.exe w/ mshtml but not have it display the print confirmation dialog.

I tried using onlyconnect.HtmlEditor but when I use LoadDocument, and pass in the full path of a html file located in the temporary files folder, I get:
An unhandled exception of type 'onlyconnect.HtmlEditorException'

occurred
in
htmleditor.dll
Additional information: Document not created



Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

162 posts views Thread by Isaac Grover | last post: by
2 posts views Thread by Jay | last post: by
reply views Thread by Kresten Buch | last post: by
2 posts views Thread by Dan Sikorsky | last post: by
2 posts views Thread by MrNobody | last post: by

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.