LPARAMETERS firstform, nextform, ipages *firstform and nextform are already fullpath, ipages is integer *Redundant and not very logical structured code in testing below but *it is only test code right now LOCAL lResult, q_Acord lResult = .F. *--Merge data from vfp form fields into the pdf document form fields DO acordfil WITH nextform, nSystemID, nPolicyID, nFormID xPDF = nextform =SYS(1104) xPDF = UPPER(hdir+SYS(2015)+SYS(3)+".PDF") newfile = UPPER(hdir+SYS(2015)+SYS(3)+".PDF") IF FILE(FULLPATH(nextform)) PRIVATE lcprtno lcprtno = ALLTRIM(STR(ipages)) lcudf = SET('UDFPARMS') SET UDFPARMS TO VALUE && this is necessary for the extract SET CLASSLIB TO ATIPDF.VCX ADDITIVE ofrmPDFTool = NEWOBJECT('Form') && Create a Form ofrmPDFTool.ADDOBJECT("oPDFTool", "PDFToolKit") IF ipages = 1 && extract only page 1 to merge WITH ofrmPDFTool.oPDFTool .LoadFromFile(FULLPATH(nextform)) .ExtractPagesTo(FULLPATH(xPDF),"1") ENDWITH IF FILE(FULLPATH(xPDF)) .AND. FILE(FULLPATH(nextform)) COPY FILE (FULLPATH(xPDF)) TO (FULLPATH(nextform)) ENDIF ENDIF * Merge Acord Forms SET UDFPARMS TO REFERENCE && for the mergedocs process IF FILE(FULLPATH(nextform)) IF nextform <> firstform && not the same pdf, merge them IF FILE(FULLPATH(firstform)) DIMENSION doclist(2) doclist(1) = FULLPATH(firstform) doclist(2) = FULLPATH(nextform) *--Tried with/without next line and also as ,0 COMARRAY(ofrmPDFTool,10) WITH ofrmPDFTool.oPDFTool .MergeDocs(@doclist) .SaveToFile(newfile) ENDWITH IF FILE(FULLPATH(newfile)) COPY FILE (FULLPATH(newfile)) TO (FULLPATH(firstform)) ENDIF ENDIF ENDIF ENDIF IF TYPE('ofrmPDFTool') = "O" .AND. !ISNULL(ofrmPDFTool) ofrmPDFTool.RELEASE() ENDIF ofrmPDFTool = NULL RELEASE ofrmPDFTool RELEASE CLASSLIB ATIPDF SET UDFPARMS TO &lcudf ENDIF IF FILE(xPDF) DELETE FILE (xPDF) ENDIF IF FILE(FULLPATH(nextform)) lResult = .T. ELSE lResult = .F. ENDIF RETURN lResultHowerver, according to my last response from Gnostice via email (they are in India so the communication is very slow and very frustrating), they are building a new ocx for us to test on Monday because they could not get it to work from VFP either. They told me that they will create an additional method to use in lieu of mergedocs for foxpro. When we purchased the toolkit, they knew we were using it from VFP. We'll see...