|InfoPath Developer Reference|
Occurs after the import (or merge) operation has successfully completed.
Version Added: InfoPath 2003
expression An expression that returns a XDocument object.
This event handler does not allow users to cancel an operation.
If the merge operation includes merging multiple forms, the OnAfterImport event occurs only after all forms have been merged and the complete operation is successful.
|The OnAfterImport event handler cannot be created using Microsoft Office InfoPath 2007 design mode; it must be created manually.|
Creating the OnAfterImport event handler
To create the OnAfterImport event handler, you must add the OnAfterImport event handler declaration to the form's primary scripting file. Open Microsoft Script Editor (MSE) and enter the following event handler declaration:
|Visual Basic for Applications|
In the following example, the OnAfterImport event handler is used to display a message box that informs the user that the merge operation completed successfully: