Create Mailing Labels from a Repeated Dialog

From HotDocs Wiki

Jump to: navigation, search

You can use HotDocs to print names and addresses on mailing labels. For example, if you have a repeated dialog in a template that gathers names and addresses for individuals being served pleading papers, HotDocs can merge that information into a table for printing on mailing labels. As shown below, mailing labels can be arranged on a sheet in one or more columns (the numbers correspond to the order of the labels):

Labels1.png

The one-column layout is the simplest to automate because you can just create the first row of the table and repeat it as many times as needed. To create mailing labels in two or more columns, however, you must consider additional factors. Instead of repeating the first row for each repetition of the dialog, you must repeat it only once for every 2, 3 or more repetitions. Also, for each of the additional columns after the first, you must use explicit indexing to indicate that HotDocs should use different answers for the variables in each column.

Caution: This article only discusses creating labels ordered from left to right and top to bottom, as illustrated above. Ordering labels one column at a time (top to bottom, then left to right) is much more complicated.

To create mailing labels from a repeated dialog, you must complete the following parts:

  • Create a new template with the same margins as the label sheet, and create a table for the first row of labels.
  • Create a repeated dialog with variables for the label information, such as name, address, city, state, and ZIP code.
  • Insert variables in each column.
  • Repeat the first row of the table and apply a filter based on the number of columns.
  • Add explicit indexing to each variable in the second and subsequent columns, and use IF instructions to conditionally include the text in those columns.

Part 1: To create a new template and the first row of the table

  1. Find or create a word processor document with a table set up for the label sheet you want to use. For example, if your label sheet has two columns and five rows, your document will contain a table with two columns and five rows. Also, make sure the margins are correct and match your label sheet. Note: Both Word and WordPerfect include built-in templates you can use to create a document with a table for mailing labels. (See the word processor's help files for information about using these templates.)
  2. At the HotDocs library, create a new template and select the document found or created in the previous step as the initial contents.
  3. At the new template, delete all rows after the first row. An example of what the table should look like at this point is shown below. (Your table may or may not contain text, depending on whether the original document contained text.)

    Labels2.png

Part 2: To create a repeated dialog with label variables

  1. At Component Manager, create a new dialog and select Spreadsheet or Repeated Series from the Style drop-down list.
  2. Create each variable required in your labels (such as name, address, city, state, and ZIP code) and add them to the dialog. You can also copy these variables from an existing component file.

Part 3: To insert variables in each column of the table

  1. In the first cell of your table, insert each of the variables from the repeated dialog:

    Labels3.png

  2. Copy the variable fields from the first cell and paste them in the second (and subsequent) cells of the first row:

    Labels4.png

Part 4: To repeat the first row of the table and apply a filter

  1. Select the first (and only) row of the table and click the REPEAT Field button. The REPEAT Field dialog box appears.
  2. Select the repeated dialog from the Dialog drop-down list.
  3. Click the Edit Component button next to the Filter by drop-down list. (If the Filter by drop-down list is not visible, click Show Advanced.) The Computation Editor appears.
  4. In the Variable name box, enter a name for the filter, such as Filter 1.
  5. In the Script box, enter the following script, where 2 is the number of columns in your table: REMAINDER( COUNTER, 2 ) = 1

    As the dialog is filtered, HotDocs will create a new row in the table each time this filter is true. Thus, for a two-column table, a new row will be inserted each time COUNTER is an odd number.

  6. Click OK to close the Computation Editor, then click OK to close the REPEAT Field dialog box. The REPEAT instruction and filter is added to the table, as shown:

    Labels5.png

Part 5: To add explicit indexing and IF instructions in subsequent columns

  1. For each variable field in the last column of the table, type [COUNTER * 2] after the variable name, but before the closing chevron. (Replace 2 with the number of columns in your table.)

    Labels6.png

  2. Select all variable fields in the last column, then click the IF Field button. The IF Field dialog box appears.
  3. Select IF Expression from the Field type group, then enter the following in the Expression box, where People Served is the name of your repeated dialog and 2 is the number of columns in your table, like this: COUNT( People Served ) >= COUNTER * 2
  4. Click OK. For two-column tables, your template is now complete:

    Labels7.png

For tables with more than two columns, the index for variables in the "inside" columns is the COUNTER multiplied by the number of columns, minus the number of columns from the right column. Thus, if there are three columns, the index for variables in the second column is (COUNTER * 3) - 1. For four columns, the same variables in the second column would use (COUNTER * 4) - 2.