>>How do you print a MS Word document from within VFP? I want to put a button on a form and when they press it, a MS Word document prints.
>
>The solution that Ed gave you may work, but the problem is that MS Word does not close the document if it is printing, and the user dialog may appear.
>So, you need to check whether the printing is finished, and only then close the document. See Message #
963992 of how to do it.
>
>Anyway, I do not think that you need word automation for this. This should work as well:
>
>
> DECLARE INTEGER ShellExecute ;
> IN SHELL32.DLL ;
> INTEGER nWinHandle,;
> STRING cOperation,;
> STRING cFileName,;
> STRING cParameters,;
> STRING cDirectory,;
> INTEGER nShowWindow
>
>? ShellExecute(0,"print",fullpath("yourwordfile.doc"),"","",0)
>clear dlls
>
I tried it. My code does not bring dialog, while your code flashes Word screen.
Edward Pikman
Independent Consultant