Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SendKeys to close Word
Message
 
To
07/03/2001 11:37:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00482494
Message ID:
00482762
Views:
10
>Hi George,
>
>As I've explained, I didn't write the code, I inherited it. I've modified it to run a different version of Word in a different directory.
>The routine code follows:

< snip >

Hi Paige,

I couldn't get it to work either. However, with the Windows Script Host, I did manage to close Word with the following:
oShell = CREATEOBJECT('WScript.Shell')
oShell.AppActivate("Microsoft Word")
WAIT WINDOW "" TIMEOUT .1
oShell.SendKeys("%{F4}")
This sends the Alt-F4 keypress combination to Word (even if minimized) and shuts it down. Does this help?
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform