Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print MS Word documents from VFP
Message
From
15/05/2007 15:38:55
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01225671
Message ID:
01225756
Views:
23
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform