Fill existing Mail Merge Word Document with ListView control Data?

To make use of Word MailMerge in c# “out of the carton” Word may simply utilize data that it acquires in particular ways. In this scenario, how are you acquiring the information coming from the “400 system” (perform you imply an IBM collection 400 system or whatever they call all of them now?)?

I’m eager to perform the alternating course of positioning all the data along with headers in to a delimited.txt data if I can not set the records from mind. The trait is I can’t figure out exactly how to in code make use of this.txt report for the MailMerge. The MailMerge Document already exists, I’m merely looking for in C# how to open words document, load the MailMerge along with my records coming from the.txt documents, and also then specified the document to print.

Some identical applications I have actually looked over use the Word Document by composing first the Headers and afterwards the query end result records to a.txt file, which is then made use of as the source for the Mail Merge Word Document. Like I claimed, I possess certainly never tinkered Mail Merge previously, yet, definitely would not it be feasible to process the records in my ListView straight right into the Mail Merge operation?

You need to use Word’s OpenDataSource technique to attach to the.txt data that you made. In the most basic scenario, all you must need to have is to give the 1st parameter to that procedure, i.e. the course+documents label – because instance, it will most likely assist if you use button characters as field delimiters, CRLFs as file delimiters, and wrap information that isn’t time or even numerical kind in double quote characters (char 34), doubling up any sort of char 34 characters in the information. Utilize the MailMerge contest establish the output to the ink-jet printer, at that point make use of MailMerge.Execute to print.

I have produced a basic C# Windows Forms Applicaiton that queries data coming from a 400 unit as well as returns the lead to a ListView control. I am currently seeking to refine this data in to an actually existing Mail Merge Word Document. Any person have expertise using this form of point that could aid me out? This is my very first time along with Mail Merge.

Leave a Reply

Your email address will not be published. Required fields are marked *