Home - Advanced Q&A

how to use MindModel to do a mail merge

A "mail merge" is an activity where you merge data from a database (in our case, a model) with some standard text to produce customized letters.

Each letter will contain some standard information and some custom information.

The standard information is the same in all the letters produced.

The custom information is read from the model.

Show me an example of a mail merge.

So, in a simple mail merge you might have the following letter:

Dear John Doe,

Thank you for purchasing MindModel.

I hope the weather is nice in Springfield this time of year.

If you have any questions at all about the software, please feel free to call or email.

Best regards,

Adam Leffert

CEO, MindModel Corporation

 

NOTE: The border is not part of the letter. It is just there to show you where the letter begins and ends.

When you do a mail merge, you create multiple letters, one for each noun (usually a person or an organization).

In our example, the name "John Doe" and the city "Springfield" are custom information. This information was read from the model. Each letter sent will have a different person's name and city name.

So how do I do a mail merge in MindModel?

There are two ways to do a mail merge in MindModel.

1) Using the Custom Column View Window (CCVW).

2) Using XML Templates.

 

Option one (Custom Column View Window) is easier than option two (XML Template), but option two (XML Template) gives you more flexibility.

So we suggest you try option one first. If that works for you, stick with that option.

If you need more flexibility than option one provides, try option two.

1) How to do a mail merge using the Custom Column View Window (CCVW).

Microsoft Word and many other word processors allow you to do mail merges.

(This section shows you how to use Word to do a mail merge. If you're using another word processor, consult the documentation for that word processor for specific instructions.)

To do a mail merge using Word, you need a main document and a data source.

You will create the main document in Word, and the data source in MindModel.

You will then use Word to merge the main document with the data source, completing the mail merge.

 

Follow these steps:

a) Follow the instructions in Word's help file to create a main document.

The main document is a Word document that contains the information (words and pictures) that will be the same for each letter (which Word calls a "merged document").

b) Create a CCVT (in MindModel) to help you create a data source document.

Let's say your data source needs to contain the person's name and home city.

To create that data source document, you would first create a custom column view template (CCVT) that contains those two columns.

For information on creating a CCVT, refer to the section: "Key Concepts: custom column view template (CCVT)".

c) Open the CCVW in MindModel.

Once you've created a CCVT with those two columns, open a Custom Column View Window (CCVW) based on the CCVT you just created.

For information on the CCVW, refer to the section: "Feature Guide: Windows: Custom Column View Window".

Use the commands in the CCVW to select the people you want to include in your mail merge.

d) Export the data from MindModel to Excel.

Use the "File Menu: Export View Items to Excel" command in MindModel to export the names and cities to a spreadsheet.

If you don't have Excel installed on your PC, you can use the "File Menu: Export View Items to a Text File" command instead.

e) Save the spreadsheet as a text file.

Use Excel to save the spreadsheet as a text file. This text file will be your "data source document" for the mail merge in Word.

Open the text file, and add a line to the beginning of the file.

This line will contain the column names, separated by tab characters, with a carriage-return at the end of the line.

f) Use Word to merge the main document with the data source document.

Follow the instructions in Word's help file to merge the main document (a Word document containing your standard information) with the data source document (the text file you exported from Excel).

Once you've merged the two documents, you can print the results.

Word has many powerful mail merge features. You may find them useful for creating video labels, reports, or other types of documents.

 

2) How to do a mail merge using XML Templates.

MindModel's XML templates allow you to create complex reports based on information in your model.

If your mail merge is simple, you'll probably want to use the Custom Column View Window instead, as described in section #1, above.

If your mail merge is complex, you can create an XML Template, then use that XML Template to create a report.

The report will be saved as a text file. Open the report in Microsoft Word or any other word processor to print the results.

To learn how to create XML templates, refer to the section: "Key Concepts: XML Template".

You can test your XML Template by adding it to the Noun Summary Window.

 

Once your XML Template is ready, you can use the "Reports Menu: Create Report for Nouns in the Nouns List from XML Template" command to create the mail merge as a text file.

When this command creates the text file, it will create one text file containing all the merged information.

To separate the text file into pages, so each page corresponds to one person in the mail merge, follow these steps:

a) Add a <staticText> element to your XML Template, so that each section ends with identical text. You can use "end of record" (without the quotes), but any text will do.

b) Use the "Reports Menu: Create Report for Nouns in the Nouns List from XML Template" command and your XML template to create a text file.

c) Open the text file in Microsoft Word.

d) Use Word's "Edit Menu: Replace" command to replace "end of record" (without the quotes) with "^m" (without the quotes).

Word will insert a page break wherever the "end of record" text was found in the document.

 

Power-User Tip: You can also use Word's "Replace" command to replace static text with pictures. Refer to Word's help file for information on how to do this.