Printing Word documents with C#

  • Thread starter Laurent Navarro
  • Start date
L

Laurent Navarro

Hi,

I created a C# application which opens a Word document, fills some
fields and sends the whole document to the printer. Everything is working
great but I find the printing step very slow. Each printing order takes
about 2 or 3 seconds to complete which can be long when you have 200
different documents to print.

I'm using Word because I want the users to be able to easily create some
templates containing specials fields that the application can fill with data
taken from a database. I'm using the printOut() function and the _Document
class contained in the Interop.Word.dll library.

Does anyone knows a way to speed up the printing step ? Or prehaps
another way to fill a Word document and print it ?


Thanks and happy new year :)

Laurent
 
D

DeveloperX

Is there any reason you can't use mailmerge? If you want your app to
generate custom data you could have the app write the data to a
database, then have Word manage the mail merge for you (That can be
managed via code if you so desire, saving any user interaction). The
benefit is Word knows how to do mailmerge so it's quick, and it
generates one file instead of two hundred which will print faster than
creating 200 seperate documents.

If you've not tried it, have a play with mail merge in word without
worrying about the programmatic side of things so you can get a feel
for it, how it retrieves data, how fields are set up and so on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printing hyperlinked Documents 1
C#, Word document 3
word 2007 and C# 1
printing in C#.Net 1
printing in c# 3
Word Document saving vb.net 2
Word document reporting 3
Word and Excel 2013 printing in red 2

Top