Found older thread that may give you some pointers
Re: Using shellexec to print from Adobe Thread #
1117459 Message #
1118015>Would 12 seconds be better? A faster printer? I was going to try it on a faster machine. Now, I don't think that will help.
>
>How do I know when printing is finished?
>
>I have to resolve this problem. What do you think?
>
>
>>I would guess that it's timing issue. The ShellExecute() launches PDF printing and code execution continues before printing is completed. Your arbitrary 10 seconds delay may not be enough in all cases.
>>
>>>Thanks Sergey. Here it is.
>>>
>>>
>>>LOCAL lcfile
>>>
>>>lcfile = m.pcfile
>>>
>>>if vartype(lcfile) <> "C" OR empty(ALLTRIM(lcfile))
>>> messagebox("No parameters passed to printpdf.", 0+16+0,"Error")
>>> return .f.
>>>endif
>>>
>>>**ShellExecute API declaration
>>>DECLARE INTEGER ShellExecute ;
>>> IN SHELL32.DLL ;
>>> INTEGER nWinHandle,;
>>> STRING cOperation,;
>>> STRING cFileName,;
>>> STRING cParameters,;
>>> STRING cDirectory,;
>>> INTEGER nShowWindow
>>>
>>>* Open.
>>>* ShellExecute(0, "Open", lcfile, "", "", 1)
>>>
>>>* Print.
>>>ShellExecute(0, "Print", lcfile, "", "", 0)
>>>
>>>return .t.
>>>
>>>
>>>
If it's not broken, fix it until it is.
My Blog