Thursday, January 25, 2018

Customized postcards using MS Word MailMerge

Okay, so the challenge this past weekend was how to print 2 sided postcards with customized fields.

The address side of the card will have the contact address (of course).  The other side needs to have a customized message to the recipient.  Using MS Word's mail merge feature is an obvious approach to doing this but there are some hurdles to overcome.

Here's what you need to know.

Connecting to the data source.  
In my case, I used SQL Server.  I had a table with all the contacts and created a View to supply the selected records needed for the job and setup some concatenated fields in the query.  A spreadsheet works just as well.  For example:

[Mailing City] + '  ' + [Mailing State Province] + '  ' + [Mailing Zip Postal Code] AS CSZ

Also, note that the field names contain spaces.  When Word connects to the data source, it will substitute an underscore "_" for the space in the field names.  Use the Mailings -> Select Recipients to connect to your data source.

Post Card stock
Avery #5689 and #8387 are 4 1/4" x 5 1/2" postcards which is a standard, USPS accepted size.  You get 4 cards per page and the template you can download from Avery simply gives you a 2x2 table to layout the card.

USPS specs
This page lays out the format you need -> https://www.summitprintingpro.com/resources/postcard-specs.html

MS Word document
Starting with a document from the template, you need to make a copy of the table on a 2nd page to have address side and message side.  You will be printing double sided, 4 cards per sheet.  

The trick
To make this all work you need to setup the following:
  • For each of the 4 cards on the message side, you will layout the text and put in the Merge fields for the personalized data.
  • At the end of the merge fields, you will insert the Next Record command (rule) to move the data pointer to the next record in your source data.
  • The problem is - when you do that, you can no longer get back to a prior record to print the name/address on the address side.
  • The solution is to use bookmarks to store the 4 name/address data sets when the message side is being processed - and refer to them on the address side.
  • On the address side, instead of Insert Merge Field you will insert references to the bookmarks that contain the saved name/address data.
Working with Field Codes
To see and edit the field codes needed, use the following commands:
  • Alt-F9 - this switches the display of the fields codes off and on.
  • Ctrl-F9 - this will convert the selected text to a field code.
  • Ctrl-Shift-F9 - this will remove the field code.
  • Mailings -> Preview Results - this will display data from the source, only valid when not displaying the field codes.

Setup Bookmarks
You will need the following 12 bookmarks: Name{1-4}, Address{1-4} and CSZ{1-4}. To setup the bookmarks, go to Insert -> Bookmark and you get a dialog like this:

Add each of the 12 bookmarks.

Message side
On the message side page, type in and format the text for your mailing.  Add in any merge fields to personalize the message.
After the last merge field, use the following field codes to save the merge data into the bookmarks:

{ Set FullName1 { MERGEFIELD FullName } }
{ Set Address1 { MERGEFIELD 
Mailing_Address_Line_1 } }
{ Set CSZ1 { MERGEFIELD CSZ } }

Now, you can't just type that in and expect Word to figure out what you mean.  That's where the Ctrl-F9 comes into play.  With field code display turned on (Alt-F9), type in "MERGEFIELD FullName", select that text, then press Ctrl-F9.  It's converted to a field code.  Then Type in front of the left brace "{", "Set FullName1 ", then select "Set FullName1 { MERGEFIELD FullName }" and press Ctrl-F9.  Now you have entered the field codes to retrieve the data from FullName field and store it into the bookmark named FullName1.  

After all the mergefields and Set codes, insert the Next Record rule.

When done, looks like:


Do all of this for the 1st card table cell, then copy / paste into the other 3 cells and edit the bookmark numbers to 2,3,4.
On the last cell, do not put { NEXT } as the merge process automatically does it each time it processes the document.  (That is to say, (I think) it processes the document, then does a Next, if there is a record returned, it reprocesses the document and keeps doing that until no record is returned.  If you leave it in, it will skip every 5th record, but you won't see anything unusual when previewing, it only happens when the Finish & Merge is processed.)

Address side
On the address side, instead of using merge fields, we will use the bookmarks to place the name, address, csz on the post card.

Where you want to put Name / Address / CSZ, type in the bookmark for the appropriate entry and use Ctrl-F9 to set it as a field code.  You're actually using the REF field code which is used to reference a bookmark.  A bookmark name by itself is assumed to be a reference.  So each of the addresses will look like:



The next thing to be aware of is that when printing double sided you need to figure out which address is on the back side of which message to be sure they are aligned properly.  So print a test case and figure it out as it could be different with different printers. In my case, the message side was:


1
2
3
4
 and the address side was:
3
4
1
2

So that's it.  

Here's a sample document with all the goodies in it.

Footnote: When you take the PDF file to a printer (Office Depot for example), you may have to tweak how the face and address match up on the 2nd page for their specific printer.
Also, and this is important, be sure they do not cut the sheets down smaller than a proper postcard size!  In my case, they got carried away on the trimming and USPS almost rejected them as being too small.  Two (2) cuts are all that are needed to give you 4.25" x 5.5" cards.