Initiates a merge operation.
success = WordProcessor.mergeFirstRecordFromInfoBus(itemName)
Fieldname1 Fieldname2 Fieldname3 ... Fieldnamen field1 field2 field3 ... fieldn field1 field2 field3 ... fieldnThe first row in the array supplies the names of the fields; subsequent rows represent the field data to be merged. For example:
"First" "Last" "EMailAddr" "Subject" "Cynthia" "Smith" "csmith@somewhere.com" "Product questions"
<b><VAR NAME="First">First</VAR> <VAR NAME="Last">Last</VAR></B><P> <b><VAR NAME="EMailAddr">e-mail Address</VAR></b><P> Subject: <B><VAR NAME="Subject">Subject</VAR></B><P> <P> Dear <B><VAR NAME="First">First</VAR>:</B>The bold text shows the opening <VAR> tag of each merge field. In the current example, fields named "First", "Last", "EMailAddr" and "Subject" have been specified. Note that "First" is referenced twice in the template. In the merge operation, all template text between the close of the <VAR> tag and the start of the </VAR> tag will be replaced by the supplied field data. In the example above, the template text when loaded into the word processor appears as follows:
First Last e-mail Address Subject: Subject Dear First:but after a merge operation the text appears as:
Cynthia Smith csmith@somewhere.com Subject: Product questions Dear Cynthia:
<HTML> <HEAD> <TITLE>WP merge example</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> <PRE> <SCRIPT LANGUAGE="JavaScript"> <!-- function doMerge() { // Create a dataitem of merge data to publish on the InfoBus. var vec = document.MyIBBridge.createInfoBusBridgeVector(); // Set the values in vector. vec.addValue( 0, 0, "First" ); vec.addValue( 0, 1, "Last" ); vec.addValue( 0, 2, "EMailAddr" ); vec.addValue( 0, 3, "Subject" ); vec.addValue( 1, 0, document.myForm.FirstName.value ); vec.addValue( 1, 1, document.myForm.LastName.value); vec.addValue( 1, 2, document.myForm.EMail.value ); vec.addValue( 1, 3, document.myForm.Subject.value ); //and so on. // Publish the vector to the InfoBus. document.MyIBBridge.publishVectorToBus( "wpmerge", vec ); // Tell WP applet to initiate the merge. document.MyWP.mergeFirstRecordFromInfoBus( "wpmerge" ); //Assume that there are nine more rows of data to be merged. for (i=1;i<10;i++) { //Do something useful with the merged data, // for example, print or save the current document to a file. //Then repeat the procedure. document.MyWP.MergeNext( ); } } // --> </SCRIPT> </PRE> <APPLET NAME="MyIBBridge" CODE="lotus.ibtools.InfoBusBridge" CODEBASE="..\.." WIDTH=1 HEIGHT=1> </APPLET> <APPLET NAME="MyWP" CODE="lotus.wp.WordProcessor" CODEBASE="..\.." WIDTH=500 HEIGHT=450> <PARAM NAME="URL" VALUE = "myserver.com\docs\WPTemplates\mywptemplate.html"> </APPLET> <FORM NAME = "myForm"> <INPUT TYPE="button" VALUE="Merge" ONCLICK="doMerge()"> </FORM> </BODY> </HTML>