Create/edit a MS Word mailmerge document (for automation with Raffle Tickets)

Download Raffle Tickets program

This article contains information on using Mail Merge in general, but is specifically to enable you to customise your own raffle tickets. The file does not need to be called Raffle.doc, but that is what you need to examine in order to understand how to get what you want.

(The source file Raffle.htm needs no change, unless you wish to change the language or add more records for test purposes. The easiest way to add more records is to run the program raffle.exe, as raffle.htm gets updated each time - double click raffle.htm to view it in your browser. Return for more information on editing HTML files.)


Open Raffle.doc in Word.

You will see just one raffle ticket. You may just need to change the text in the right half. If so, that's easy, no need to read on.

Notice it is a 2 column document - see menu Format>Columns. We are trying to get as many tickets as possible on one page, to be cut up later with a guillotine. You do want "Equal column width" as the ticket is repeated (once for each data record) down the first column until full and then down the second. You may want to adjust the gutter between - see "Spacing:". (If you want large tickets, one column no problem.)

With your cursor in the ticket, which is a table of exactly one row, see menu Table>Table Properties... Under the Row tab, notice the option "Allow row to break across pages" is unticked. Look at the Column tab. This is where you can reduce the width if the ticket does not fit your printer.

If you click just below the table, there is one blank line. I have used this to adjust the vertical space between tickets. See menu Format>Paragraph... "Line spacing:" = "Exactly" , "At:" = the required value.


Click on <<F01>>

The whole item turns grey. This is because it is a merge field called F01, the same name given in the first row (the header row) of the source file Raffle.htm, to be replaced by data when the merge is run.

To insert a merge field, place your cursor where the field is required, see menu Insert>Field... Under "Categories:" choose "Mail Merge". Under "Field names:" choose "MergeField". In the description field below, the text "MERGEFIELD " will appear. Add the name of your field, for this program, "F01". The description should now read "MERGEFIELD F01" without the quotes. OK.


See menu Tools>Mail Merge... Notice it has been saved only with Step 1 set up - Create button>Catalog...>Active Window button. Catalog means repeat sequentially, on the same page, for each data record. If you have specially cut paper where you want a new page for each ticket, use Create button>Form Letters...

Preferably save before you connect the data source to prevent problems. If you save it with the data source attached, you can disconnect it later by:- Move Raffle.htm to another folder temporarily. Re-open Raffle.doc in Word. When it can't find the data source you get the chance to disconnect it (Options>Remove Data/Header Source).

To test it, do Step 2, Get Data> Open Data Source... and navigate to Raffle.htm, Open. If it asks you to "Confirm Data Source", you must choose "Word Documents (*.doc)" even though it is an HTML file.
Step 3, Merge. Accept the defaults and click the Merge button.

That's it. Return for more information or read on for a step-by-step description of creating Raffle.doc from scratch.



Create Raffle.doc from new

Open MS Word. Using the default new document presented, see menu File>Page Setup...
Click the Paper Size tab and set up the size required. On the Margins tab, change all the values to zero, click OK. A message will appear asking you to fix or ignore illegal margins. Choose Fix. This will set the minimum margins for your particular printer. Preferably set the left and right margins the same. Note the values for the next step. Click OK

Menu Format>Columns...
Click the Presets two column icon. Change the value under Spacing to the sum of your left and right margins just set. This is the gutter between the two columns. OK.

Menu Table>Insert>Table...
Set the number of columns to 2 and the number of rows to 1. OK. A table with solid lines round the cell appears. Leaving your cursor in the first cell create the dash tear off divider as follows

Menu Format>Borders and Shading...
1. Select Apply to : Cell
2. Click the right margin icon
3. Click the dashes line under Style:
4. Click the right margin icon again
OK

Back on the page, move the mouse over the dash line, and when it displays as hold it down and drag left to adjust the columns to the proportions required.

Menu Table>Table Properties...
Click the Row tab. Untick "Allow row to break across pages". OK.

Menu Table>AutoFit>Fix Column Width
to stop the columns moving as you type.

In order to get decent dotted lines, see menu Tools>AutoCorrect...
Untick "Replace text as you type". OK
(otherwise Word converts each 3 dots to a leader character.)

Select the font and point size required (eg Times New Roman, 10) either from the toolbar or from menu Format>Font...

Ensure there is no space between paragraphs, menu Format>Paragraph...
Spacing Before: 0 pt
After: 0 pt

Type "Name:" and hold down the full point to fill the line exactly, Return key. Same for "Contact:" and the following 5 lines.

Menu Insert>Field...
Under "Categories:" choose "Mail Merge". Under "Field names:" choose "MergeField". In the description field below, the text "MERGEFIELD " will appear. Add "F01" (eff zero one, after the wordspace). OK. Click the Align Right icon in the toolbar.

Click in the second column and repeat the process with the text/graphics of your choice.

Click under the table. Menu Format>Paragraph...
Spacing Before: 0 pt
After: 0 pt
Line spacing: Exactly
At: set to the vertical space you want between tickets, probably the same as the gutter you set between columns.
OK
Hit the space key and return key to create a blank paragraph.

Menu Tools>Mail Merge...>Create>Catalog...>Active Window, Close.
Menu File>Save As...

Test as described above, ie
Menu Tools>Mail Merge...
Step 2, Get Data> Open Data Source... and navigate to Raffle.htm, Open. If it asks you to "Confirm Data Source", you must choose "Word Documents (*.doc)" even though it is an HTML file.
Step 3, Merge. Accept the defaults and click the Merge button.

You will probably need several tests before it is right.
a) If the two columns don't line up at the top, the separator line under the table is being turned over. Several remedies,
Adjust the pointsize/leading of the text to increase/decrease the ticket size, or
File>Page Setup... adjust the bottom margin, or
Table>Table Properties>Row (with your cursor in the table) adjust the size of your ticket
b) On printing, if the right hand rule doesn't print, with your cursor in say the right column,
menu Table>Table Properties>Column
reduce the column width.

Return for more information