Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print MS Word documents from VFP
Message
 
À
15/05/2007 13:41:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01225671
Message ID:
01225753
Vues:
26
>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
Good Luck
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform