My previous post was because I was having problems adding a bcc to sendmail. That is now solved thank you. Now I am trying to put A5V11 on a windows 10 machine and whilst most other tables work properly, this sendmail code in the acounts table doesn't. The error message says 'File not found: 'C:\Program Files (x86)\A5V11\Laprima\Accounts June\Acct 001.pdf''
The code works on an XP machine, and on the W10 machine, the directory Accounts June is made but there is no Acct 001.pdf or anything else in it, so it looks to me as if the report is not being saved. Any help would as always be appreciated.
Here is the code;
'Date Created: 19-Oct-2013 03:07:47 PM
'Last Updated: 05-Jun-2016 07:32:53 PM
'Created By : usuario
'Updated By : Laura Johnson
parentform.commit()
tbl = table.current()
tbl.fetch_first()
'debug(1)
while .not. tbl.fetch_eof()
query.filter = "cuscode = "+quote(alltrim(tbl.cuscode))
query.order = ""
to_param = Lookup("Customers2","cuscode = "+quote(alltrim(tbl.cuscode)),"alltrim(email)")
if alltrim(to_param) > "" 'only execute this section if an email address is found
subject_param = "Monthly account from Laprima S.L."
message_param = "Your attached account covers the month of "+cmonth(date())+"."
'attachments_param = ""
'cc_param = a5_eval_expression("",local_variables())
bcc_param = a5_eval_expression("[email protected]",local_variables())
if filefind.get(a5.Get_Path()+chr(92)+"Accounts "+cmonth(date()),FILE_FIND_DIRECTORY,"PN") = ""
dir_create(a5.Get_Path()+chr(92)+"Accounts "+cmonth(date()))
end if
:report.SaveAs("AccMonthly","PDF",query.filter,query.order,a5.get_path()+chr(92)+"Accounts "+cmonth(date())+chr(92)+"Acct "+alltrim(tbl.cuscode)+".pdf")
sleep(4)
email_send(to_param,subject_param,message_param,a5.get_path()+chr(92)+"Accounts "+cmonth(date())+chr(92)+"Acct "+alltrim(tbl.cuscode)+".pdf","",bcc_param)
sleep(4)
end if 'end of section to create and send email if address found
tbl.fetch_next()
end while
fil.flush()
fil.close()
The code works on an XP machine, and on the W10 machine, the directory Accounts June is made but there is no Acct 001.pdf or anything else in it, so it looks to me as if the report is not being saved. Any help would as always be appreciated.
Here is the code;
'Date Created: 19-Oct-2013 03:07:47 PM
'Last Updated: 05-Jun-2016 07:32:53 PM
'Created By : usuario
'Updated By : Laura Johnson
parentform.commit()
tbl = table.current()
tbl.fetch_first()
'debug(1)
while .not. tbl.fetch_eof()
query.filter = "cuscode = "+quote(alltrim(tbl.cuscode))
query.order = ""
to_param = Lookup("Customers2","cuscode = "+quote(alltrim(tbl.cuscode)),"alltrim(email)")
if alltrim(to_param) > "" 'only execute this section if an email address is found
subject_param = "Monthly account from Laprima S.L."
message_param = "Your attached account covers the month of "+cmonth(date())+"."
'attachments_param = ""
'cc_param = a5_eval_expression("",local_variables())
bcc_param = a5_eval_expression("[email protected]",local_variables())
if filefind.get(a5.Get_Path()+chr(92)+"Accounts "+cmonth(date()),FILE_FIND_DIRECTORY,"PN") = ""
dir_create(a5.Get_Path()+chr(92)+"Accounts "+cmonth(date()))
end if
:report.SaveAs("AccMonthly","PDF",query.filter,query.order,a5.get_path()+chr(92)+"Accounts "+cmonth(date())+chr(92)+"Acct "+alltrim(tbl.cuscode)+".pdf")
sleep(4)
email_send(to_param,subject_param,message_param,a5.get_path()+chr(92)+"Accounts "+cmonth(date())+chr(92)+"Acct "+alltrim(tbl.cuscode)+".pdf","",bcc_param)
sleep(4)
end if 'end of section to create and send email if address found
tbl.fetch_next()
end while
fil.flush()
fil.close()
Comment