Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inactive Word Object.
Message
From
18/07/2002 14:12:36
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00680097
Message ID:
00680105
Views:
30
This message has been marked as the solution to the initial question of the thread.
>Does anyone know how to test for an active application of WORD.

Ron,

Please try the following:
 If IsAppRunning         ( "OpusApp" )           &&  Checks if MS-Word already running
    oWord = GetObject    (,"Word.Application")   &&  Conects to the running instance
 else
    oWord = CreateObject ( "Word.Application")   &&  Creates a new instance
 endif

 . . .
 
 Function IsAppRunning
*-------- ------------
 LParameters pAppClassName

 Private cClassName, cNullPointer, nRetCode

 nRetCode      = 0
 cNullPointer  = .Null.
 cAppClassName = pAppClassName

 Declare Integer FindWindow In Win32API As CheckForWindow ;
         String  @cAppClassName, ;
         String  @nNullPointer

 nRetCode = CheckForWindow (@cAppClassName, @cNullPointer)

 Release cClassName, cNullPointer

 Return IIf (nRetCode = 0, .F., .T.)

 EndFunc     && IsAppRunning

*============================================================================
Hope it helps,

Fernando
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform