Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know if the Word is closed?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00963921
Message ID:
00963944
Views:
7
Thanks Mike, I'll try it first think in the morning.

>Api Call
>
>http://www.news2news.com/vfp/?group=54&function=246
>
>WMI
>
>
lcComputer = '.'
>loWMIService = Getobject('winmgmts:' ;
>    + '{impersonationLevel=impersonate}!\\' + lcComputer + '\root\cimv2')
>colProcessList = loWMIService.ExecQuery ;
>    ('Select * from Win32_Process')
>Create Cursor Process (Name c(20),Id i,Thread i,pagefile i,pagefault i,workingset c(20))
>Index On Name Tag Name
>For Each loProcess In colProcessList
>    Insert Into Process (Name,Id,Thread,pagefile,pagefault,workingset);
>        VALUES (loProcess.Name,loProcess.ProcessID,loProcess.ThreadCount,loProcess.PageFileUsage,;
>        loProcess.pagefaults,loProcess.WorkingSetSize)
>Next
>BROWSE normal
>
>
>>Thanks Mike, but how?
>>
>>>You could check if the process is running or not. Either with an API call or WMI.
>>>
>>>>I create & run MS Word MailMerge, but I don't want the user go back to VFP until he/she closed the Word Window. Untill now I use Cetin's MailMerge Class to find the window of teh MaiMerged Letters & go in a DO WHILE loop. But now some of my users have a MS Office builder in different languages so tha caption of the Form Letter Document vary due to language. So may question is How to know if the user closed the Word Window?
>>>>
>>>>
>>>>myWord = CreateObject("Word.Application")
>>>>**** do a Mail merge
>>>>**** close all additional Word Windows as Main Document & DataSource
>>>>DO WHILE FindWindow(0, "MicroSoft Word - Form Letters") # 0 && But "that caption now is varying :o(((
>>>>  DO EVENTS
>>>>ENDDO
>>>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform