DECLARE Integer ShellExecute ; IN shell32.dll ; Integer hwndParent, ; String cVerb, ; String cFilename, ; String cParameters, ; String cDirectory, ; Integer nCmdShow LOCAL lcTyp as String, lcFile as String, lcPrinter as String, ; liHwndMain as Integer liHwndMain = _SCREEN.HWnd STORE [] TO lcTyp, lcFile, lcPrinter lcTyp = [Document:doc,pdf;Text:txt;Table:xls;Picture:jpg,bmp,tif,gif,png] lcFile = GETFILE(lcTyp,[Select],[open],1,[Select file]) lcPrinter = GETPRINTER() IF FILE(lcFile) liReturn = ShellExecute(liHwndMain,[printto],lcFile,["] + lcPrinter + ["],[],0) IF liReturn <= 32 * Display Message ENDIF ENDIF RELEASE llExistsErrorCrs, llDeclareStatus, ; lcTyp, lcFile, lcPrinter, ; lcMailto, lcSubject, lcBody, ; liHwndMain, liReturn CLEAR DLLS [ShellExecute]