CFOG's PIP, June 1988, Volume 7 No. 4, Whole No. 66, page 50
MailMerge Without Pain
by Benjamin H. Cohen
I don't know about you, but I have this love-hate relationship going with WordStar and MailMerge. WordStar is a great tool, though I use VDE for almost all of my writing and editing because of its sheer speed. And the power of the dot commands and MailMerge's merging power and conditionals are just wonderful. But...
The first thing you should do (or should have done long ago when I told you to, see PIP #41, page 3, March 1986), is to change the delimiter for your MailMerge files to a "/" instead of a comma. That done you can enter commas in fields to your heart's content and never have to put in a quotation mark before and after a field. If you have some slashes in your data, try a backslash. Or whatever suits you.
But even using slashes instead of commas for delimiters, entering data for MailMerge data files is a pain. You have to remember to enter "//" when there s a missing field. When you forget you get a rude awakening at print-out time. And counting the slashes or commas is never fun. I've used a simple macro to search for the correct number of delimiters, starting on the first delimiter in a line. When it winds up on the wrong delimiter, i. e., not the first, you have to check the line. Ouch.
In fact, I never enter big data files using WordStar or VDE. For big databases I use PC-File 80 and export the files to comma-delimited files after sorting and selecting the records that I want. But for little form letters, to a dozen people, it's more rigmarole than seems necessary.
You could write a small MailMerge file to ask for each field's data and write it to a file. Like using PC-File 80, that has the virtue of making sure you have the right number of fields for each record, but there's the setup and testing to make sure it's correct. For the project I did today, a dozen form letters, maybe 20, it seemed excessive.
One of the simple things that we learned, but forgot, is that you can enter MailMerge data with fields delimited by a <cr>. Yes, you can enter each field on a separate line:
Benjamin H. Cohen
KaftorWare Corporation
Box 1674
Chicago, IL 60690
Is a perfectly valid MailMerge data file of one record consisting of four fields. If you want to set your data up this way, set your page length so that WordStar marks each record as a page:
.pl nn
.mt 0
.mb 0
This sets the top and bottom margins to zero so the page is exactly as many lines long as your record has fields, "nn". There's a visual marker at the end of each page to make sure you have entered the correct number of fields in each record. You can do this with VDE by setting the page length with ^OP, but you won't get the visual marker, just a change in page number.
My data file for today's project consisted of four line addresses. Some of the addresses actually only had three lines, so I had to hit an extra <cr> for those to leave a blank line. But each address in the file looked just like an address on a letter, rather than like a telephone directory. That's visually reasurring, I think.
My letter was a simple inquiry for information. I merge-printed the letters and shoved them into window envelopes. No extra step of putting labels on. No extra step of printing labels. Sure, I could have simply photocopied the letter, but it was no big deal, and probably cheaper, to run the dozen or so letters on my dot matrix printer.
So, for short and simple MailMerge data files, consider using a file with each field on a separate line.