Hi,
I need to have the ability to take HTML files and print them out to a
printer (each document may have to be sent to a different printer). This
needs to be done without user interaction (i.e. some type of batch/server
process). Here is what I tried so far:
1. Automate Word within a service. Word would open the HTML file and then
print it. This seems to work consistently only when the service is running
on a workstation. It also seems to fail with certain print drivers.
2. Create a application that wraps the AxWebBrowser control. This would
load up the HTML document and when the DocumentComplete event is fired, it
would print using the ExecWB() method. This seemed to work very nicely, but
every once in awhile, the ExecWB call would hang. There were even times
after executing that call that the application would just blow up -- no
exceptions; no Dr. Watsons, nothing.
My goal is to have some type of process in place where we can drop HTML
files into a directory (or some type of definition file that describes the
document, where it is supposed to go, etc.) and print it. Does anybody know
of any code snippets or even some controls that would allow me to do this?
Again, I would prefer to do this within a service, but if I can't, then I
can't.
By the way, how would I be able to get a context for the AxWebBrowser
control so that it would render the document?
Thanks a bunch!
cj