A
Andrew Mercer
Hi,
I am needing to batch print a number of Word documents.
Some of these are already created others are created on the fly from
database data using Interop.
The problem I am having is printing the already created documents, it locks
up Word and confuses the print queue.
The process is:
1. Build doc 1v1 and print
2. Build doc 2v2 and print
3. Print doc 3
4. Build doc1v2 and print
5. Build doc 2v2 and print
6. Print doc 3 etc...
For each build and print, Word is activated (but not made visible). A pop up
automatically appears(not coded by me but part of Word) to show printing is
being done, this closes and the next item is then printed.
After 3 or 4 items it locks up and I can only release the printer by
manually closing the automatic pop up that has not closed.
I have even tried printing the 'NON-On the fly' documents using the C#
Process call but the same locking happens.
I finally tried to check the current state of the printer queue and delay
passing the document to the printer if the queue is greater then [N],
however this did not prevent the locking (also the print queue status did not
always return valid information).
Can anyone suggest the best way to over come these issues? Currently I am
forcing a timeout between each print call. This does resolve the issue but
there must be a better way!
Any suggestions?
Thanks Andrew
I am needing to batch print a number of Word documents.
Some of these are already created others are created on the fly from
database data using Interop.
The problem I am having is printing the already created documents, it locks
up Word and confuses the print queue.
The process is:
1. Build doc 1v1 and print
2. Build doc 2v2 and print
3. Print doc 3
4. Build doc1v2 and print
5. Build doc 2v2 and print
6. Print doc 3 etc...
For each build and print, Word is activated (but not made visible). A pop up
automatically appears(not coded by me but part of Word) to show printing is
being done, this closes and the next item is then printed.
After 3 or 4 items it locks up and I can only release the printer by
manually closing the automatic pop up that has not closed.
I have even tried printing the 'NON-On the fly' documents using the C#
Process call but the same locking happens.
I finally tried to check the current state of the printer queue and delay
passing the document to the printer if the queue is greater then [N],
however this did not prevent the locking (also the print queue status did not
always return valid information).
Can anyone suggest the best way to over come these issues? Currently I am
forcing a timeout between each print call. This does resolve the issue but
there must be a better way!
Any suggestions?
Thanks Andrew