Share via


Application.MailMergeDataSourceValidate Event

Word Developer Reference

Occurs when a user validates mail merge recipients by clicking Validate in the Mail Merge Recipients dialog box.

Syntax

Private Sub expression_MailMergeDataSourceValidate(ByVal Doc As Document, Handled As Boolean)

expression   A variable that represents an Application object that has been declared with events in a class module.

Parameters

Name Required/Optional Data Type Description
Doc Required Document The mail merge main document.
Handled Required Boolean True if the add-in has handled the validation event. This is a forward-only parameter and cannot be set in code. To set this value, you must use the MailMergeDataSourceValidate2 event.

Remarks

If you do not have address verification software installed on your computer, the MailMergeDataSourceValidate event allows you to create simple filtering routines, such as looping through records to check the postal codes and removing any that are non-U.S.

Bb221329.vs_note(en-us,office.12).gif  Note
The Handled parameter does not function correctly in this version of the event; use the MailMergeDataSourceValidate2 event. In addition, you cannot raise this event from within a Microsoft Visual Basic for Applications (VBA) project. This event functions correctly only in COM add-ins. For managed add-ins and external applications, use the MailMergeDataSourceValidate2 event.

For information about using events with the Application object, see Using Events with the Application Object.

See Also