I have an accounting system for contractors. They deal with a lot of correspondence between themselves and their subcontractors and suppliers. Some of this can be taken care of with form letters. Currently I have setup a form database that has the location and name of the document/spreadsheet to be accessed. I then display this database in the vendor form in a MRO that has a button on each record, each button label comes from the description of the form database. (IE: button 1 is labeled NOTICE TO PROCEED, b2 is RELEASE OF LIEN...) On the push button method of the button I have created the following code:
T = CREATE "

RIV:__MERGE.DB"
WITH "VENDOR#" : "A6" ,
"VENDORNAME" : "A30" ,
"VENADD1" : "A30" ,
"VENADD2" : "A30" ,
"VENCITY" : "A30" ,
"VENSTATE" : "A2" ,
"VENZIP" : "A15" ,
"VENCONTACT" : "A30"
KEY "VENDOR#"
ENDCREATE
TC1.OPEN("

RIV:__MERGE.DB")
TC1.EDIT()
TC1.INSERTRECORD()
TC1.VENDOR# = MAINKEY
TC1.VENDORNAME = VENDORNAME
TC1.VENADD1 = VENADD1
TC1.VENADD2 = VENADD2
TC1.VENCITY = VENCITY
TC1.VENSTATE = VENSTATE
TC1.VENZIP = VENZIP
TC1.VENCONTACT = VENCONTACT
TC1.POSTRECORD()
TC1.ENDEDIT()
TC1.CLOSE()
strDir = LOCATION
strDoc = APPNAME
IF NOT ISFILE(STRDIR+STRDOC) THEN
MSGSTOP("CAN NOT OPEN FILE","Reason: Can not find a file named "+ STRDIR+STRDOC+ "\"; please check the name.")
ELSE
ShellExecuteA(0,"open",STRDOC,"",STRDIR,0)
ENDIF
This allows my users to click on the desired form letter and manually run a mail merge with the exported vendor info. I would like to have the ability to automatically run the merge from within word based on a selection made in the form database. (IE if mailmerge="Y" then xxxx endif) I would also like to have the ability to save the document and reference it in another Notes database that is in our system. That way if they want to look up that correspondence they could.
Thanks for the reply, let me know if you have any ideas.
James D. Howard