![]()
This book is designed as a resource guide, to help you understand WordPerfect 6.1/7/8's advanced merge feature. The book emphasizes the Windows version of WordPerfect, but you'll also find information on the DOS version of WordPerfect. With just a few differences, the merge feature works the same in WordPerfect versions 6 through 8 for both DOS and Windows.
WordPerfect includes a very useful feature called Merge. The merge feature can help you quickly produce mass mailings, labels, envelopes, letters, lists, legal documents, and a score of other projects. Merging allows you to quickly combine information stored in a data file with a template, or form file. You can also supply information "on the fly" while you merge.
You can merge data that is stored in a database program such as
Microsoft Access, or you can create Data files right in
WordPerfect, with codes to mark the end of fields and records.
Once the data file is complete, you can merge it with a Form file.
(1)
The form file includes any formatting you desire for the finished
document, as well as text and special codes to mark where fields
of data from the data file will be inserted. A form file can also
contain commands to make decisions, calculate values, or other
programming functions. When you merge a data file with a form
file, you get a completely new, separate file made up of elements from both the data and form
files.
Before you begin, you should have a strong working knowledge of WordPerfect: how to open and save documents, change margins, paper size, and font types, how to print, etc. A working knowledge of a programming language such as PerfectScript is also very helpful, but not required. In fact, knowing PerfectScript can greatly enhance your advanced merges. For more information on PerfectScript, you may want to purchase a copy of WordPerfect Advanced Macro Programming: A Learning Guide. See my web site at http://www.wpmacros.com for more information.
This is a good question, and often the answer is based on personal preference. Both macros and merges can perform some of the same tasks. Generally, if you are dealing with lots of data that is stored on your hard drive, whether in a merge data file or a database file of some other type, merge will be able to manipulate that data more easily than a macro, without a lot of work on your part. It takes a lot of time and experience to write an effective macro that will interact with a database file, and usually the process will be much faster with a merge.
If your data is usually supplied by the user at the time of the document generation, a macro is probably better. You have a lot of capabilities with WordPerfect dialog boxes that are not available in merges. For example, a macro can display a dialog with check boxes, radio buttons, drop down lists, spinner controls, and so on. This functionality is not available in merge, although a merge can nest to a macro that provides the functionality.
Generally, merge files can be used cross-platform without any conversions. This means that a user working in WordPerfect 8 for Windows 95 can use the exact same merge files that a user with WordPerfect 6.1 DOS can use. With the exception of one command that is not available in DOS (REPEATROW), some interface issues, and some differences in the names of the SYSTEM variables, the same merge file will return the same results in both versions of WordPerfect.
Macros, on the other hand, must be written and compiled specifically for the version of WordPerfect they will be used in. While converting from one Windows version to another is not too time consuming, converting the same macro to work in WordPerfect for DOS can be a nightmare.
If you'd like to learn more about macros, you may want to purchase one of my macro books. See my web page at http://www.wpmacros.com for availability and information on how to order.
Section 1: The Basic Merge will explain the basics of merging: how to make both data and form files, and how to merge them together. We'll talk about the most common merging techniques. This section contains as much information as you need for basic, simple merging. You should understand this section thoroughly before continuing further into the book.
Section 2: The Advanced Merge Commands will show you how each advanced merge command is designed to work. The exercises illustrate important merge concepts, and also give you practice at creating your own merge files. Most of the lessons in this section include quizzes to help you learn the ideas presented in the lesson.
Section 3: Applications contains special applications for projects that can be accomplished with the advanced merge language. Many variations of the basic merge are available, and we'll cover many common variations in this section. You can use these applications as they are, or modify them to meet your individual needs. By studying these applications, you can also gain insight on how the advanced merge commands can be used.
The Appendix includes an ASCII Value chart, a CTON (Character to Number) Value chart, ?RightChar Value charts, answers to the quizzes, a Merge Troubleshooting Guide, and other valuable reference material.
The applications disk that accompanies this book contains most of the merge examples that you'll see throughout the book. The disk is organized by lesson number and application number to help you quickly find the files pertinent to the lesson you are currently working on. You can enter the merge commands as you see them listed in the book, or if you are in a hurry, you can use the file that is on the disk instead.
You are welcome to incorporate any of the merge routines used in the application files in your own merges, and to make modifications to them as needed to fit your personal preferences and data.
When you're done working through this book, you should have a good understanding of the way WordPerfect merges work, and the many different ways you can manipulate data with merge. You'll be able to create complex documents with speed and ease. And you should find the reference material in the Appendix useful as you create more specialized merges in the future.
Although you'll be able to adapt many of the examples directly into your applications, remember that the purpose of this book is not to give you the exact keystrokes or code sequences for your particular application. Rather, it will give you the foundation of knowledge you need to understand each of the advanced merge commands so that you can create your own merge files to your own specifications, have fun while you're doing it, and avoid some of the frustrations of programming. You are limited only by your imagination in the types of merges you can create.
If, after working through the book you feel you no longer need it, you may want to use it as a doorstop or paperweight, or give it to a co-worker as a white elephant gift. If you do this, the more notes and scribbles you make in the book, the better. ; ) But hopefully you'll find it useful to keep the book around for a while.
Throughout this book, I will follow certain conventions.
| All screen shots were created in WordPerfect 7 for Windows 95. The dialogs and screens you see in your version of WordPerfect may vary in appearance but should be similar enough that you can find your way around. | |
| Dialog names are shown in bold. | |
| Merge commands are shown in a Courier font to help you differentiate them from the rest of the text. |
FIELD(Name)
FIELD(Address)
FIELD(City), FIELD(State) FIELD(Zip)
| The book places emphasis on the Windows version of WordPerfect, but the DOS version's merge language is essentially identical to that of the Windows version (with one or two exceptions). I've placed the steps for WordPerfect for DOS in a box to help DOS users find it more easily, and to allow Windows users to skip this information. |
|
Appearance of merge codes in WordPerfect for DOS
In WordPerfect for DOS, the merge codes will appear as bolded text. The current field name will be displayed in the lower left corner of the screen. |
| I always give variables a name that starts with a lowercase v (for variable). This will help you keep variable names straight from label names, field names or text. This also helps to assure that you don't inadvertently use a reserved word as a variable name. For example, vFilename is a possible variable name. | |
| Text that you will need to type is shown in italics. | |
| Examples of how a command might be used are shown in a box: |
IF("FIELD(company)"="Acme Widgets")COMMENT(
)We appreciate your company's business. ENDIF
|
Most commands have parameters. Some parameters are required and some are not. In this book I list each parameter and give detailed information about what WordPerfect expects to find in that parameter. I will mention whether a certain parameter is optional and give information about what happens (if anything) if you don't include that parameter. If you are uncertain about whether a parameter is optional, look in the Merge Codes dialog box in WordPerfect. Optional parameters are displayed within square braces [].
You should work through the exercises as you come upon them in the lessons. They are designed to help you understand concepts. Exercises are shown in a box also, and are in a smaller font.
With the preliminaries covered, we'll jump right in to the wonderful world of merging.
1. In earlier versions of WordPerfect, these files were called secondary and primary files.