In Hell, You Have To Use MS Word Mail Merge

I’m starting to get old. How do I know this? Well, one way is that I remember with fondness mail merges in WordPerfect. Ah, but we don’t use WordPerfect any longer. We use Word. Word has a perverse mail merge system. I have no idea how office admins (whom I assume are the target market for this feature), learn how to use this system efficiently. My hat is off to them.

Some years ago, in an effort to save money, I inherited the task of creating an electronic face book of our students. It shows some basic information:

  1. A photo (if we have one)
  2. The student’s name
  3. Their undergraduate institution
  4. Their major(s)
  5. Their graduate institution, if any, along with graduate degree earned, as well as area of graduate study
  6. Their permanent city and state

I have produced this both in gridded form and row form for some time.

To generate these, I’ve used the fantastic ReportLab Python PDF library, and I’ve also used Pentaho’s Report Designer. The backend data is stored in a spreadsheet and/or a database table. The issue, of course, is that I’ve never turned this service back into a turn-key offering that could be handed off to someone else. This is the curse of the small shop (or the unskilled coder). You have enough time to write 60% of what you need to write – enough to get the job done and enough to get some kudos on the first iteration of the product.

However, you now own what was essentially an administrative task and one that would have been done with glue and scissors 20 years ago and would not have required IT intervention. So, I started looking at MS mail merge, because I thought, how hard could it be? Right? Perhaps that would be a way to hand off this task to someone else. Geez.

Here’s a screen capture of what the merge codes might look like to load up one entry:

Mail merge for a face book.

Really? This is what is required for an admin to come up with a reasonably basic entry that includes a picture based on the value in a field and also deals with missing data reasonably well. There are lots of neat nested expressions. Whitespace is significant to printing, as well, so you’ll need to triple check that. Note that I haven’t yet dared to tackle blank lines generated by the absence of grad-school data. It gets better… If you load up a label template with all of this code, you will not be able to see the bottom parts of it. You will also need to deal with a cryptic wizard or two along the way.

Here are some references that helped me get this far:

As for me, I think I’ll go back to updating the Python script that creates these. Once again, I tip my hat to the people who have to use MS mail merge every day. Perhaps this set of links will be helpful – also, of course, I could just be a complete ignoramus when it comes to this stuff. Any tips are most appreciated. Feel free to share in the comments.


One thought on “In Hell, You Have To Use MS Word Mail Merge

  1. Ken Hirsh says:

    As you note, this was (and still is) one of the areas where WordPerfect excelled. Though I use Word for most of my word processing now, I keep WP around for these, for longer outlines and for tables.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s