473,231 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 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 7510
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sudha | last post by:
Hi I need to write a c# program which has to merge selected word documents into one word document. Kindly advise the efficient way to achieve this. Thanks in advance sudha
8
by: Jason Steeves | last post by:
Can someone please point me in the right direction for displaying word documents onto a webpage? The word documents will contain text/tables/pictures. I am new to this and can't quite find what I...
5
by: vinod | last post by:
Hi, I intend to send word documents thru mail to my clients. I don't want my clients to save the word document to there system and i don't want them to print the word documents. How can i...
0
by: mharris | last post by:
I need help with merging two Word documents into one through C# code. The problem isn't so much getting the documents put into one as it is maintaining the appropriate formatting, or rather...
2
by: David | last post by:
Using the article from this link, http://www.codeproject.com/aspnet/wordapplication.asp, I have been playing with generating Word documents using an ASP.NET application. The only short coming...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
3
by: crashonyou | last post by:
hello again..i've been searching for quite some time now already looking for a solution to printing word documents with python..same thing for internet explorer..i was experimenting around with some...
1
by: corcoranj | last post by:
Hello everyone, I have a series of Microsoft word documents, gathered via a SQL query. I would like to be able to print these documents, no matter the number to the clients computer. I have tried...
20
MMcCarthy
by: MMcCarthy | last post by:
This problem was proposed to me but not really my area of expertise so I thought I would open it up to the forum to see if anyone had any bright ideas. The problem is generating Microsoft Word...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.