MailMerge

Syntax

MailMerge [.CheckErrors = number] [, .Destination = number] [, .MergeRecords = number] [, .From = number] [, .To = number] [, .Suppression = number] [, .MailMerge] [, .MailSubject = text] [, .MailAsAttachment = number] [, .MailAddress = text]

Remarks

Sets options for a mail merge, merges the main document with the specified data records, or both. If the active document is not a main document, an error occurs.

Argument

Explanation

.CheckErrors

Specifies how to check and report mail-merge errors:

0 (zero) Simulates the mail merge and reports errors in a new document.

1 Performs a mail merge, pausing to report each error as it occurs.

2 Performs a mail merge and reports any errors in a new document.

.Destination

Specifies where to send the merge documents:

0 (zero) New document

1 Printer

2 Electronic mail; messaging application programming interface (MAPI), vendor independent messaging (VIM), and Apple Open Collaboration Environment (AOCE) are supported.

3 Fax

.MergeRecords

Specifies whether or not to merge a subset of the data records:

0 (zero) Merges all data records.

1 Merges the range of data records specified by .From and .To.

.From

The number of the first data record to merge.

.To

The number of the last data record to merge.

.Suppression

Specifies whether or not to print blank lines for empty merge fields:

0 (zero) Does not print blank lines.

1 Prints blank lines.

.MailMerge

Performs the mail merge (omit .MailMerge if you want to set options only).


Argument

Explanation

.MailSubject

If the destination is electronic mail, specifies the subject text.

.MailAsAttachment

If 1, and if the destination is electronic mail or fax, sends the merge documents as attachments.

.MailAddress

If the destination is electronic mail or fax, specifies the name of the merge field that contains the electronic mail address or fax number.


Example

This example merges the main document with data records 50 to 100 and sends the merge documents to a new document:


MailMerge .CheckErrors = 2, .Destination = 0, .MergeRecords = 1, \
    .From = 50, .To = 100, .MailMerge

See Also

MailMergeCheck, MailMergeQueryOptions, MailMergeToDoc, MailMergeToPrinter