I
Igor
I have an application that prints documents in the background and quits. So
the code goes something like this:
wordApp.Visible == false;
.....
.....
mydoc.PrintOut( ........ )
Thread.Sleep(2000); // Temporary Fix
mydoc.Close(......)
wordApp.Quit(.......)
Now, I was running into this issue where certain documents that are large
were not being printed. I narrowed it down to the closing of Word immediately
after PrintOut(). When I took away the Close() and Quit(), all documents
printed fine but were leaving the winword process running in the background.
So as a tamporary solution, I have added a Thread.Sleep(2000) immediately
after PrintOut and it works fine. Would the best solution be to have the
PrintOut command in a worker thread? It also seems odd that it's closing the
document before it finishes printing. Any ideas on why this is happening?
Also, when I stepped through the code in debug mode, it would work fine.
Thanks,
Igor
the code goes something like this:
wordApp.Visible == false;
.....
.....
mydoc.PrintOut( ........ )
Thread.Sleep(2000); // Temporary Fix
mydoc.Close(......)
wordApp.Quit(.......)
Now, I was running into this issue where certain documents that are large
were not being printed. I narrowed it down to the closing of Word immediately
after PrintOut(). When I took away the Close() and Quit(), all documents
printed fine but were leaving the winword process running in the background.
So as a tamporary solution, I have added a Thread.Sleep(2000) immediately
after PrintOut and it works fine. Would the best solution be to have the
PrintOut command in a worker thread? It also seems odd that it's closing the
document before it finishes printing. Any ideas on why this is happening?
Also, when I stepped through the code in debug mode, it would work fine.
Thanks,
Igor