Below is some code we have used without problem for years through Win7. It creates a PDF using eReports, saves it to a temporary file and, if successful (if lnResult=0), creates the Outlook email.
Suddenly, on Win10 boxes, it is returning lnResult="-121"
I can't figure out what the error means - any ideas? Thanks!
****UPDATE - the perplexing part is that the PDF is actually created and in the temp folder, yet the value of lnResult is not zero****
CASE nBarNum=7
l_coldpath=SYS(5)+SYS(2003)
SET PATH TO c:\qdms2004
LOCAL lnResult, oPDF
p_recnum=STR(RECNO("cofc"))
l_attachment='c:\windows\temp\qdms\cert.pdf'
l_stdtext="Attached is Certificate of Compliance No. ";
+THISFORM.Qdmsbasepgf1.Page1.txtCertnum.VALUE +" for ";
+ALLTRIM(THISFORM.Qdmsbasepgf1.Page1.txtMatl.VALUE);
+" as you requested."+CHR(13)+" "+CHR(13);
+"If you have any further questions, please contact XXXXXXX"
oPDF = NEWOBJECT ("eReportsPDF", "eReports.dll", "eReports.dll")
oPDF.UNLOCK("xxxxxxx xxxxxx - XXXXXXX XXXXXX XXXXX XXXXX")
oPDF.EmbedFonts = 0
oPDF.JPGQUality=5
oPDF.ReportFile = "qcf75.frx"
oPDF.OutPutFile = "C:\Windows\Temp\qdms\Cert.Pdf"
oPDF.ReportExpr = "RECORD "+p_recnum
lnResult = oPDF.ReportConvert()
SET PATH TO TO l_coldpath
IF lnResult=0
Phil Thomas
http://phillipdthomas.comNever let your energy or enthusiasm be dampened by the discouragements that must inevitably come.....