Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inactive Word Object.
Message
De
18/07/2002 14:12:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00680097
Message ID:
00680105
Vues:
29
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform