471,594 Members | 2,045 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Printing Word documents with C#

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
Jan 2 '07 #1
1 7337
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.

Laurent Navarro wrote:
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
Jan 2 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by sudha | last post: by
8 posts views Thread by Jason Steeves | last post: by
5 posts views Thread by vinod | last post: by
reply views Thread by mharris | last post: by
2 posts views Thread by David | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.