=============
Installation
=============

1) Extract files in zip to "C:\"
   This will create the following directories

   c:\amergedemo
   c:\amergedemo\control
   c:\amergedemo\data
   c:\amergedemo\dev_bin
   c:\amergedemo\exports
   c:\amergedemo\Merge Shortcuts
   c:\amergedemo\readme
   c:\amergedemo\temp
   c:\amergedemo\templates

2) Ensure merge_run.asn in "control" directory matches your environment

Note the line reading:
wordexe      = C:\Progra~1\Micros~1\Office\WINWORD.EXE

This is in shorthand notation and should point to the MS-Word executable such that running the line will start word. On some systems, depending on the components installed with Word the numbers may vary so for example it could be your executable is referenced as

wordexe      = C:\Progra~1\Micros~2\Office\WINWORD.EXE

This can be checked by going into MSDOS and changing directory to see the short path name.
When correct START->RUN and the string should start an instance of word.


3) Ensure merge_dev.asn in "control" directory matches your environment
See point (2)

4) Place copy of usys.dol and usys.urr in the "control" directory

5) Ensure the shortcuts in the directory "Merge Shortcuts" match your environment

6) Import c:\amergedemo\exports\merge_demo.exp

7) From command line run "/con", "/all", "/dol", and then "/urr ulana"

8) Import data files in directory "c:\amergedemo\data" into the application

9) Place "c:\amergedemo\control\logic_dosdir.dll" in uniface "bin directory" and then ensure
the file usys.ini contains the following lines

[userdlls]
path=c:\usys7206\bin
demandload=logic_dosdir.dll


=========
Runtime
=========

1) Run the start up shell "merge.aps". 3 options will be displayed:

1a) Document Templates

Allows the insertion text for the merge and the merge template to be stored in the database as a blob. For any merge you need 2 records, one for the text to insert and the other a mail merge template. An example of these files has been created in the exported data.

1b) Data to Merge, in this example the entity PEOPLE contains some sample data

1c) Mail Merge, select the records you want to merge, press the mail merge button and then select the options for the merge.

Template            : Name of the merge template to use (lookup is available)
Merge Text          : Text to use with the template (lookup is available)
Preview / Edit      : Allow you to view / edit the template prior to merge
Supress Blank Lines : Allows blank lines to be supressed
Merge Destination   : Printer, Document or Mail

If mail is selected then the merged document can be attached, or be part of the main mail message, also you need to specify a mail subject. In this demo to mail out the name of the merged field for Email must be "EMail".


2) Creating a new mail merge

2a) Create a CSV file in the directory "templates" with 2 lines one a header line and the second a sample data line:

i.e. 
TITLE, NAME, EMAIL
Mr, Michael Levene, mlevene@computalink-systems.com

2b) Create a document template for the merge

In word select mail merge and select the file created in (2a) as the datasource. Then insert merged fields as required in the document. Save the document in the templates directory as a DOC file.

2c) Create some insertion text and save in the templates directory as a TXT file.

2d) Using the program load the merge insertion text and the document template as records.

2e) Create a service to generate the data file (see s_per_merge for example)

2f) Call s_merge.op_merge1 to prepare the template and data

2g) Call s_merge.op_merge2 to run the mail merge

Clearly the demo runs a merge on PEOPLE and would require minor alteration to support other merges or multiple doucment source structures.


Quick Overview of Components
===============================

F_PERSON_MERGE		allows selection of records to be merges, selection passed
			as list to F_MERGE

F_MERGE			Selection of merge options, runs:-
			S_PER_MERGE, S_MERGE

S_PER_MERGE		Generates data file for merge

S_MERGE			Prepares template and created mail merge

There is also included the following service which you may find usefull:

S_SPELL			Run WORD's spell checker on any block of text. 

The uniface software was developed by Michael Levene (http://www.computalink-systems.com)
and is provided FOC, with license to use it freely without liability for problems
encountered, warranty or support.

