Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing Word Documents
Message
 
To
24/09/1999 16:01:21
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00268749
Message ID:
00268780
Views:
20
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform