Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
hjc621
Post
by hjc621 » Tue Dec 10, 2002 5:20 am
I am trying to determine if Outlook is open or minimized and then close it. If I try to "Run Program" then "Close window" it just opens a new window which is then closed leaving the original still minimized.
How can the minimized Outlook be closed?
Thanks
HJC621
-
Guest
Post
by Guest » Tue Dec 10, 2002 5:29 am
hjc621 wrote:I am trying to determine if Outlook is open or minimized and then close it. If I try to "Run Program" then "Close window" it just opens a new window which is then closed leaving the original still minimized. I am using Win XP.
How can the minimized Outlook be closed?
Thanks
HJC621
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Tue Dec 10, 2002 9:31 am
Hi,
Try using CloseWindow, or:
Use SetFocus to focus the Outlook window and then close it by sending the appropriate keystrokes (ALT-Fx probably).
SetFocus will make a window active, whether it is minimized or not. "Run Program" is no good as this will start another instance of the application. What you want to use is SetFocus.
-
FS
Post
by FS » Tue Dec 10, 2002 10:16 am
If you use SetFocus on a minimized windows, does it still remain minimized?
Can you use ALT-Fx on a minimized Windows?
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Tue Dec 10, 2002 10:22 am
No, using SetFocus on a minimized window will restore it.
-
Armstrong
Post
by Armstrong » Tue Dec 10, 2002 11:01 am
I wrote the following macro to meet your requirement:
Code: Select all
IfWindowOpen>Microsoft Outlook*,doClose
Goto>End
Label>doClose
SetFocus>Microsoft Outlook*
Press ESC
Press ALT
wait>0.1
Sen>f
Release ALT
Sen>x
Label>End
It works fine on my computer. Bear in mind, Microsoft Outlook allows multiple instances.
Armstrong Wong
Hong Kong
-
Ernest
Post
by Ernest » Tue Dec 10, 2002 11:23 am
Hi,
what about --> WindowAction>3,Microsoft Outlook*
E.
-
Armstrong
Post
by Armstrong » Tue Dec 10, 2002 11:50 am
Definitely, you have the most brilliant code. Thanks.
Armstrong
Hong Kong