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
closing a minimized program
Moderators: Dorian (MJT support), JRL
Re: closing a minimized program
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: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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.
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.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
No, using SetFocus on a minimized window will restore it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I wrote the following macro to meet your requirement:
It works fine on my computer. Bear in mind, Microsoft Outlook allows multiple instances.
Armstrong Wong
Hong Kong
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
Armstrong Wong
Hong Kong