lparameters tcSQL, tcTemplate, tnDestination, tlShow, tlWaitWordFinish * Calling : thisform.mmerge(tcSQL [[, tcTemplate][, tnDestination][, tlShow] [,tlWaitWordFinish]]) * Parameters *!* tcSQL - SQL for mailmerge data w/o destination. *!* ie: [select * ]+; *!* [from (home()+"SAMPLES\DATA\employee") ]+; *!* [where title = "Sales"] *!* tcTemplate - Optional. If specified tcTemplate will be used as template doc. *!* tnDestination - Optional. Default none. None, Doc or Printer (0,1,2). *!* tlShow - Optional. Default show (.t.). ie: with tnDestination 2 and tlShow .f. *!* just prints and exists. .f. requires tcTemplate specified. *!* When destination is not 2 (printer) tlShow is ignored. *!* tlWaitWordFinish- Optional. Default (.t.). If .f. execution continues. *!* Sample calls : *!* 1-Select all fields from current alias and show new document ready with merge fields. *!* thisform.mmerge([select * from (alias())]) *!* 2-Select all fields from home()+"samples\data\employee" where title like "Sales%" *!* and print using "c:\Temp\myTemplate.doc", do not show word window at all. *!* thisform.mmerge([select * from (home()+"SAMPLES\DATA\employee") ]+; *!* [where title like "Sales%" ] ,; *!* "c:\Temp\myTemplate.doc" , 2, .F.)As you can see all you do is to supply an SQL and optionally a template. As in last sample calling, you can define an SQL + a template and get printout w/o showing a word window. If you want to build template on the fly then you use "insertmergefield(cMergeFieldName)".