# MergeEvent Object

An event object that is used during an OnMergeRequest event. The MergeEvent object provides properties and methods that can be used during an OnMergeRequest event to programmatically interact with a form's underlying XML document and to determine merge properties such as the number of files being merged.

## Remarks

During a single merge forms operation, multiple OnMergeRequest events will occur. One OnMergeRequest event will occur for each file being merged.

Note This object model member is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Service Pack 1 or later is not installed. Any form that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.

## Using the MergeEvent object

The MergeEvent object is passed as a parameter to the OnMergeRequest event of an InfoPath form. The properties that it provides are available only during this event.

## Example

In the following example, the DOM property and ReturnStatus property of the MergeEvent object and the ImportDOM method of the XDocument object are used to import (merge) a form from the OnMergeRequest event handler:

    function XDocument::OnMergeRequest(eventObj)
    {
        XDocument.ImportDOM(eventObj.DOM);

        eventObj.ReturnStatus = true;
    }

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp