>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?
>
>Thanks in advance,
Hi Ronald,
Chris beat me to the printing part. I should add that you can probably do this with OLE Automation as well. However, using ShellExecute with 0 as the show command will hide the window and Word will automatically close when printing is complete.
You can use my Is_Run32() function available in the UT download section ("Is a Windows application running") under Win32 and other APIs. One note about Word, however. The latest version, Word 2000, spawns multiple instances of itself for each document opened. So this means that regardless of whether or not a copy of it is already open, any time a new document is opened, another instance of Word is created.
George
Ubi caritas et amor, deus ibi est