DECLARE INTEGER ShellExecute IN Shell32.DLL; INTEGER hwnd, STRING @lpOperation,; STRING @lpFile, STRING @lpParameters,; STRING @lpDirectory, INTEGER nShowCmd lcfile = 'c:\mydir\mybmp.bmp' lcpath = JUSTPATH(lcfile) lcop = 'print' lnerr = ShellExecute(0, @lcop, @lcfile, 0, @lcpath, 0) IF lnerr < 33 THEN ? lnerr ENDIFIf the value is 2, then it's probably an LFN problem. In this case, I try
lcfilename = [ + lcfilename + ]
This should enclose the LFN in quotes which should resolve the problem.