The 'bulk' WordMerge operation is passed the following additional data from FFEXTERN:

An FFEXTERN window handle to notify progress

The instance UJP filename

The job size calculated by the launcher

Processing proceeds as follows:

Office 2010 or 2013 Word automation is started

The UJP file is opened and the folder with the name of the job under PREPROC is located

The WMnostrip and ReverseFS job options are obtained from the UJP, along with convert option PDFattach.  Intermediate PDF is not currently implemented.

The JCF file is read and the pre-processed job list (jobname_WM.TAB) is located.

Each FS file is then processed: before processing each 25 files, the job status is tested and if no longer active, the merge is terminated.

Files at the start of the JCF that are not found (presumably they have been already processed) are counted as skipped

The $job_item number is checked: if not as expected, the merge is terminated.

The presence of $fax_phone and $email_address commands is recorded.

Each $fax_filename designated for WordMerge is located, and an $email_attach for the same document is located if present.

The above commands are processed to determine whether to (a) create a TIF file, (b) create a PDF file, (c) save a DOC file.

For the first FS to be processed, the Word documents (output from REMOVEDS) and the data source are opened.  An open timeout causes the merge to be terminated.  If the data source record count does not match the job size, the merge is terminated

If the FS file contains multiple WordMerge documents (there is only one data source) then each document is processed in turn.

The data source active record is set to the index of the job item.

For each field in the data source active record, the content is matched against the value of the corresponding BCF field in the FS.  A mismatch terminates the merge.

The merge is executed to produce one new customized document (and the last section deleted unless NoStrip is set)

This document becomes the active document, and is assigned a name based on the current FS filename, plus _WMx, where x is the index of the WordMerge document in the FS, in the job temp folder.

If a DOC file is required for e-mail attachment, the document is saved with an extension (DOC or DOCX) matching the master document.  Currently this is always .DOC because RemoveDS always saves a .DOC file.

If a PDF copy is required for e-mail attachment then the document is saved as PDF.

If a TIF is required, communication with FFCVRT is set up and printing is initiated, to a temporary local file.  When FFCVRT signals completion, the local file is moved to the final destination.

The $fax_filename and $email_attach commands are updated with the output filename(s).

The new merge document is closed, and processing continues with the next WordMerge document, if present in the FS.

The $priority command is used to select a destination TOSEND queue.

The FS file is saved to the TOSEND queue and the original FS is then deleted from the job folder under preproc.  Failure of either operation terminates the merge.

A progress message is sent to FFEXTERN to display a progress bar.

Processing continues with the next FS file.

On completion of the merge, the Word automation object is closed and any remaining instance of Winword is killed.

The count of converted items is returned to FFEXTERN.