Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing Word Documents
Message
 
À
24/09/1999 16:01:21
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00268749
Message ID:
00268780
Vues:
19
>I have a field in a table which stores the path of a Word document. I want to create a command button on a form that when I press it, it prints the Word document. How can I accomplish that with the RUN command? Is there a way that I can incorporate DDE (Dynamic Data Exchange)? Is there a way to detect if Word is already open?

Here's a quick and dirty way that works for me (VFP 6.0 SP3, Windows 95):

DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow

ShellExecute(0,"Print",lcFileName,"","",1)

Where lcFileName contains the name of the file you want to print.

If you have VFP 6.0, there is an _environ.vcx that has a _shellexecute method you could use. I'm not sure how to tell if a user already has Word open.
Chris McCandless
Red Sky Software
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform