1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01104132"><META NAME="lcid" CONTENT="1033"><title>OnMergeRequest Event</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>OnMergeRequest Event</h1><DIV class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="appliesto" onclick="toggleList()" onkeypress="toggleList()"></span><a class="ofvbanavex" href="#example"><span class="ofvbanavreuse" id="example"></span></a><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></DIV><p>
<p>Occurs when the merge operation is invoked either from the Microsoft Office InfoPath 2003 user interface or from the command line by using the <b class="bterm">/aggregate</b> option.</p>
<p class="signature">Function <i>XDocument</i>::<b class="bterm">OnMergeRequest</b>(ByRef <i><b class="bterm">pEvent</b></i> As MergeEvent)</p>
<p>
<i><b class="bterm">
pEvent</b> </i> Required <b class="bterm">MergeEvent</b>. A reference to the <a href="xdobjMergeEventObject_HV01104134.htm" id="HV01104134" lcid=" "><b class="bterm">MergeEvent</b></a> object.</p>
</p><h2>Remarks</h2><p>
<p>If the <a href="xdproReturnStatus_5_HV01104138.htm" id="HV01104138" lcid=" "><b class="bterm">ReturnStatus</b></a> property of the <b class="bterm">MergeEvent</b> object is set to <b class="bterm">False</b>, InfoPath cancels the merge operation. If an error occurs in the code for the <b class="bterm">OnMergeRequest</b> event handler, InfoPath ignores the error and relies on the <b class="bterm">ReturnStatus</b> property of the <b class="bterm">MergeEvent</b> object. If the <b class="bterm">ReturnStatus</b> property is not explicitly set, the default value of <b class="bterm">False</b> is used.</p><p>For InfoPath forms stored in a Windows SharePoint Services form library, the <b class="bterm">OnMergeRequest</b> event also occurs when the <b class="bterm">MergeDocuments2</b> method of the <b class="bterm">OpenXMLDocuments</b> control is executed. For more information on the <b class="bterm">OpenXMLDocuments</b> control, see the SharePoint Products and Technologies 2003 Software Development Kit, which is available on the <a href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010936161033&CTT=11&Origin=HV011041321033" target="_new">Microsoft SharePoint Products and Technologies</a> Web site.</p><p>If you create an event handler for the <b class="bterm">OnMergeRequest</b> event of a form template, you must edit the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a> to set the <a href="xsfatruseScriptHandler_HV01107655.htm" id="HV01107655" lcid=" "><b class="bterm">useScriptHandler</b></a> attribute to "yes" before it will run.</p>
<p><p><b>Note</b> This object model member is not supported when the <b class="ui">Disable Service Pack features</b> option on the <b class="ui">Advanced</b> tab of the <b class="ui">Options</b> 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.</p></p></p><h2><a id="#example" name="#example">Example</a></h2><p>
<p>In the following example, the <b class="bterm">OnMergeRequest</b> event handler performs a merge operation, and it sets variables to indicate the status of the merge operation:</p>
<pre><code>var g_fMerging = false;
function XDocument::<b class="bterm">OnMergeRequest</b>(eventObj)
{
// Set global property to indicate that forms are being merged.
if (eventObj.Index == 0)
g_fMerging = true;
XDocument.ImportDOM(eventObj.DOM);
eventObj.ReturnStatus = true;
if (eventObj.Index + 1 == eventObj.Count)
{
g_fMerging = false;
XDocument.UI.Alert("Your request to merge " + eventObj.Count +
" files is now complete.");
}
}</code></pre>
</p><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/xdevtOnMergeRequest_HV01104132_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">©2003-2004 Microsoft Corporation. All rights reserved.</a>
Permission to copy, display and distribute this document is available at: <a
href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|