Printing Word 2007 Documents From VB.NET

joecasa

New member
Joined
Oct 8, 2008
Messages
1
Our application does a complex mail merge operation on Word 2007 documents.

I call it complex because based on the data, different word documents are used as templates (for instance, government regulations require slightly different wording in different states, also, some phrases are required to be bold and of a larger font for other states, etc. Also, certain customers based on the status of their accounts get completely different letters)

So the base word document is dependent on the data. Also, our company took over another company but due so some state level agreements, we have to maintain the appearance of just managing the customer accounts for the other company. This requires that depending on certain conditions in the data, the letters themselves get printed to different trays on the printer so that they come out with the appropriate letter head.

So anyway, I learned all the OpenXML SDK stuff I could and figured out how to these complex mail merge procedures and even insert the appropriate signature graphic in the document (signature graphics are based on the territory the customer is in as each territory gets a different rep and thus a different signature for each letter).

Now that I am successfully saving the new word document Ive run into a snag. The program needs to send the documents to the printer but I dont know how to do that from VB.NET and select the proper paper tray for each letter. I had figured it out for using Word Automation in Word 2003 but I cant find anyway to do it in Word 2007.

Ive figured out the settings I need for a PrintDocument object but I dont see how to tie that to a Word 2007 document and still maintain the Word formating. And formating is very important here and changes often enough (due to new business rules and government regulations) that it is required that certain office staff be able to edit the templates frequently.

Sorry if I included too much background but so many times people say things like "Just open word and click print" so I needed to make sure you understand that anywhere from 50 to 900 letters go out through this system at a time and it is not an option for our users.

Thank you for reading and forwarding any advice you may have.
 
Back
Top