You have to specify full file names including path
>
>I am using Word 2007 and Excel 2007
>
>My VFP 9 program attempts to call Word to perform mailmerge with following lines of code but encounter message that it cannot locate the XLS file.
>
>Is there anyway to setup Word 2007 so that it will look for XLSX file or CSV file instead of XLS file
>
>Would really appreciate if you could share your expertise.
>
>Thanks & Best Regards
>
>
> DECLARE INTEGER ShellExecute IN Shell32.DLL INTEGER hwnd, ;
> STRING @lpOperation, STRING @lpFile, STRING @lpParameters, ;
> STRING @lpDirectory, INTEGER nShowCmd
> lcParms = ""
> lcDir = addbs(toApplication.ProjectDirectory)+'DOCS'
> lcFile = alltrim(juststem(lcOutputFileName))+'.DOC'
> lcOp = 'open'
> lnshow = 3
> lnError = ShellExecute(0, @lcop, @lcfile, @lcparms, @lcdir, lnshow)
--sb--