_XDocumentEventSink2_Event.OnAfterImport Event

Definition

Occurs after the import (or merge) operation has successfully completed.

public:
 event Microsoft::Office::Interop::InfoPath::SemiTrust::_XDocumentEventSink2_OnAfterImportEventHandler ^ OnAfterImport;
event Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnAfterImportEventHandler OnAfterImport;
member this.OnAfterImport : Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnAfterImportEventHandler 
Event OnAfterImport As _XDocumentEventSink2_OnAfterImportEventHandler 

Event Type

Examples

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:

[InfoPathEventHandler(EventType=InfoPathEventType.<span class="label">OnAfterImport</span>)]
public void OnAfterImport(DocEvent e)
{
  thisXDocument.UI.Alert("Merge operation was successful.");
}

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:

[InfoPathEventHandler(EventType=InfoPathEventType.<span class="label">OnAfterImport</span>)]
public void OnAfterImport(DocEvent e)
{
  thisXDocument.UI.Alert("Merge operation was successful.");
}

Remarks

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.

Note: There is no user interface (UI) in the InfoPath form design window for creating this event handler. To add this event handler to the project, include the InfoPathEventHandler attribute as it appears in the example.

Note: If you create an event handler for the OnAfterImport event of a form template, you must edit the form definition file (.xsf) to set the useScriptHandler attribute of the importParameters element to "yes" before it will run.

Applies to