Steve-vfp9user
Programmer
Hello
I am trying to copy a created PDF file into it's relevant folder but I cannot get it to copy into the correct folder.
Here is what I have so far:
**********
mrecno=205 && Just to send it to a RECNO() for testing
**********
The folder that contains the quotes is named \myprogam\2022 quotes
An example folder name would be something like \myprogram\2022 quotes\quote 25-2022 job description
Both the folder name (same as the document) and pdf are created if they don't exist but the pdf is copied to the \myprogram\2022 quotes folder and not the \myprogram\2022 quotes\quote 25-2022 job description folder
I'm sure this is staring me in the face but any guidance would be helpful.
Thank you
Steve Williams
VFP9, SP2, Windows 10
I am trying to copy a created PDF file into it's relevant folder but I cannot get it to copy into the correct folder.
Here is what I have so far:
**********
mrecno=205 && Just to send it to a RECNO() for testing
**********
Code:
USE MYTABLE SHARED
GO mrecno
murn=0
murn=URN
myear=0
myear=YEAR(DATE())
IF NOT DIRECTORY(SYS(2003)+"\"+LTRIM(STR(myear))+" QUOTES\"+"Quote "+LTRIM(STR(QJOBNUMB))+ ;
"-"+LTRIM(STR(QJOBYEAR))+" "+ALLTRIM(UPPER(JOBTITLE)))
WAIT "Creating PDF quote folder and copying document, please wait...." WINDOW NOWAIT
MKDIR(SYS(2003)+"\"+LTRIM(STR(myear))+" QUOTES\"+"QUOTE "+LTRIM(STR(QJOBNUMB))+ ;
"-"+LTRIM(STR(QJOBYEAR))+" "+ALLTRIM(UPPER(JOBTITLE)))
DO LOCFILE("foxypreviewer.App")
REPORT FORM MYQUOTATION FOR URN=murn OBJECT TYPE 10 TO FILE SYS(2003)+"\"+LTRIM(STR(myear))+ ;
" QUOTES\"+"QUOTE-"+LTRIM(STR(QJOBNUMB))+"-"+LTRIM(STR(QJOBYEAR))+" - "+ ;
ALLTRIM(UPPER(JOBTITLE))+'.pdf'
DO foxypreviewer.app WITH "Release"
COPY FILE SYS(2003)+"\"+"QUOTE-"+LTRIM(STR(QJOBNUMB))+"-"+LTRIM(STR(QJOBYEAR))+" - "+ ;
ALLTRIM(UPPER(JOBTITLE))+'.pdf' TO SYS(2003)+"\"+LTRIM(STR(myear))+" QUOTES\"+ ;
"QUOTE-"+LTRIM(STR(QJOBNUMB))+"-"+LTRIM(STR(QJOBYEAR))+" - "+ALLTRIM(UPPER(JOBTITLE))+'.pdf'
ELSE
* I'll add this in when it's working
ENDIF
RETURN
The folder that contains the quotes is named \myprogam\2022 quotes
An example folder name would be something like \myprogram\2022 quotes\quote 25-2022 job description
Both the folder name (same as the document) and pdf are created if they don't exist but the pdf is copied to the \myprogram\2022 quotes folder and not the \myprogram\2022 quotes\quote 25-2022 job description folder
I'm sure this is staring me in the face but any guidance would be helpful.
Thank you
Steve Williams
VFP9, SP2, Windows 10