How to print multiple documents using C#

How to print multiple documents using C#

Post by c3BhcnJ » Wed, 24 Jan 2007 16:49:00


Hello

I have and application class instance used to genereate a number of similar
documents from a Word template, now I need all these documents printed out.

Is there a way to have the print dialog shown once and then use the settings
from that to print out all the other document so the user does not have to
see a whole bunch of dialogs.

Or is it possible to "merge" or "join" all those documents in to one single
document? and then print out that single one ?

--
Sparre
 
 
 

How to print multiple documents using C#

Post by Sparr » Thu, 25 Jan 2007 17:24:14

sparre skrev:

Ok, I might have found a solution to my problem, but I dont really know
if there is any problems with it in the long run, haven't testet it on
a larger scale.

I create at List<> of Word.Document's and each time I add a document to
the Word.Application instance I also add it to the list. The Dialog
wdDialogFilePrint prints the active document by it self so I use
Activate() on the the first document so that gets printed first. The I
use a for loop to print the rest of the documents.

This works ok, as the options chosen in the wdDialogFilePrint dialog
applies to all documents in that Word.Application instance.

Anyway this solved my problem, but if anyone know off issues with this
approach please let me know..

--
Sparre