Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MS Word and VFP Program Control
Message
 
À
13/05/2003 15:19:23
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00787854
Message ID:
00787905
Vues:
15
Hi Tracy,

In the very first time it worked with a bit of glitch.
Thanks for the help.

Aashish

>
>oWord = createobject('Word.Application')
>with oWord
> .visible=.t.
> .Activate
>endwith
>
>DECLARE Sleep IN Win32API;
>	INTEGER nMilliseconds
>
>DO WHILE .T.
>*!*		IF CHECKWIN('Microsoft Word')
>*!*			= Sleep(10) && Wait a 1/100th of a second.
>*!*		ELSE
>*!*			EXIT
>*!*		ENDIF
>	If IsAppRunning( "OpusApp")            &&  Checks if MS-Word already running
>		= Sleep(10) && Wait a 1/100th of a second.
>	ELSE
>		WAIT WINDOW "Exited VFP Correctly when word was closed." TIMEOUT 10
>		EXIT
>	ENDIF
>ENDDO
>RELEASE oWord
>RETURN
>
>FUNCTION CheckWin
>	PARAMETER tcTitle
>
>	* Routine which sees if an application is active by looking for its
>	* Window title
>	* expC1 Window title
>
>	DECLARE INTEGER FindWindow in Win32API as FindWindow STRING, STRING
>
>	RETURN IIF(FindWindow(0,tcTitle)>0,.T.,.F.)
>
>
>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
>
>
>
>>hey one more problem dear friends, With the mentioned above problem, the oMyWordObj.AppMaximize() dosent always maximize MS Word.
>>
>>Any ideas ?
>>
>>
>>>Dear friends,
>>>
>>>oMyWordObj = CREATEOBJECT('Word.Basic')
>>>oMyWordObj.AppMaximize()
>>>oMyWordObj.AppShow()
>>>
>>>The following code initiate MS Word but the control immediately return to VFP.
>>>
>>>What I want is the user to close MS word and then the control is shifted to VFP.
>>>
>>>Any ideas,
>>>
>>>Aashish
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform