Application.MailMergeDataSourceValidate event (Word)

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

Syntax

expression.MailMergeDataSourceValidate (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 don't 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.

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

Application Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.