Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if MS Word is already running
Message
From
31/10/2003 07:04:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00844785
Message ID:
00844873
Views:
12
>I have a VFP 7 application that uses OLE automation to export one or more reports to MS Word. The user has the option to open Word to review and edit the exported document(s). Right now I open each exported document in a separate instance of MS Word. The oWord object has already been released in code. Because the document(s) names change, I can't use FindWindow to reliably tell if Word is already open. If it is, I would prefer to open multiple documents within the same Word instance (some users are running Office2000 and some OfficeXP).
>
>Is there a way to determine if the WINWORD process is running from within VFP?
>
>Stephen

Stephen,
You could check it out with GetObject(). However it's not suggested and dangerous (search Word and GetObject to see a detailed discussion on why dangerous).
Continue to create it CreateObject(). Depending on OS version even with GetObject you might see as if it was separate instances (but not, Word is weird, it has only one PID in task process list, though application list might show multiple - Excel doesn't behave that way).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform