PDA

View Full Version : Solved: Print Letter and Envelope in Order



CreganTur
02-19-2008, 10:05 AM
I don't know if this is a VBA question or not, but I've got an interesting problem I need help with.

I've got an excel file of customer demographic information. I'm using a Mail Merge to merge this info onto a Letter, and also onto a custom envelope. That part works perfectly, but here's the issue:

I'm trying to find a way to set Word so that it will print the letter for Customer A and then the envelope for Customer A. Then it would print letter for customer B and envelope for customer B, ad infinitum.

Also the letter is standard 8 1/2" X 11" Portrait, but the envelope is 12" x 9" Landscape.

Is there a way to accomplish this programatically?:think:

TonyJollans
02-21-2008, 04:34 PM
Are the letter and envelope in the same document? In other words do you have envelope, letter, envelope, letter, etc.?

If so the envelope for Customer A will be in Section 1, the letter for Customer A will be in Section 2, the envelope for Customer B will be in Section 3, the letter for Customer B will be in Section 4, etc., and you can simply print the sections in the order you want: s2, s1, s4, s3, etc.

I suspect there is a limit to the length of string, s2, s1, s4, s3, ... but you could easily generate multiple prints in VBA, along the lines of (pseudo code):

For Cust = 1 to document_ref.Sections.Count / 2
document_ref.PrintOut ... "s" & Cust * 2 & ",s" & Cust * 2 -1 ...
Next Cust

CreganTur
02-22-2008, 06:18 AM
This Thread can be marked as Solved. Here's how I got it to work:

I setup the Word document with 2 pages- page 1 was the letter and page 2 was the envelope. I used the Paper tab on Page Setup to tell the document to pull the first page from Tray 2 and all other pages from Tray 3 (your printer settings may be different; for me it printed the letter on letterhead from Tray 2 and the envelopes were printed on envelopes from Tray 3).

Then I used Mail Merge (since the customer demographics were listed in an Excel Spreadsheet). Once the merge was completed, I just wrote a short program that:

-prints the current record
-navigates to the next record
-Ad Infinitum (or at least until it's done :) )

It's been working perfectly for the over 1,000 letters and envelope sets I've printed so far.