Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get my own copy of Word?
Message
 
To
21/11/2000 19:48:27
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00444424
Message ID:
00444436
Views:
8
I don't think it will work the way you want it to but there is a solution. Before you start word look to see if its already running by using getobject(,'Word.Application') instead of createobject. If word is already running then instead of closing word when you need to just close the document you are working on.

>My app uses Word to add some items from my database to a word document before shipping it off to our file server. (It's actually not even necessary (or desirable) to make Word visible while I'm doing this.)
>
>There's a little problem if the user already has Word running (started independently of my app) or starts running word while I'm doing my thing (less likely, but still I'd like to account for this case).
>
>Problem is that if there's already a copy of word running, the next attempt to start it uses the already running app. This becomes a problem when I quit word from my program. If the user had independently started word, this would quit too...and that could be disasterous if I issue a quit(wdDoNotSaveChanges) !!
>
>I'd really like to start up an independent copy of Word which I know will not be consumed by a copy already running, or consume an independent start up that occurs while I'm working.
>
>I know this will eat up memory, but I'd rather do that then deal with all the cases of trying to run in a copy of word which is completely unrelated to what I'm doing.
Rip Ryness
International Falls, MN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform