I'd like to setup an AutoHotKey script to automatically maximize Outlook upon the receipt of an unread email. I've got one for Outlook calendar notifications, but I've not been able to figure out how to do one for email though.
Thanks!
Microsoft Outlook Incoming Mail
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Microsoft Outlook Incoming Mail
This might do what you want.
Code: Select all
#Persistent ; Script must continue to run to work
global olApp
olApp := ComObjActive("Outlook.Application")
ComObjConnect(olApp, "EventApp_")
EventApp_NewMail()
{
olApp.ActiveWindow.WindowState := 0 ; olMaximized
}
This should at least get you your event then you can toy around with doing the action you want. Could just maximize Outlook with AHK window commands.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: Microsoft Outlook Incoming Mail
Thanks!
WinActivate/WinMaximize did work better for that portion of the script, but without the first part of your script I would have never gotten it to work.
Here is the script I ended up using if someone else has the same problem...
Moderator Note: Added code tags. ~ sinkfaze
WinActivate/WinMaximize did work better for that portion of the script, but without the first part of your script I would have never gotten it to work.
Here is the script I ended up using if someone else has the same problem...
Code: Select all
#Persistent ; Script must continue to run to work
global olApp
olApp := ComObjActive("Outlook.Application")
ComObjConnect(olApp, "EventApp_")
EventApp_NewMail()
{
SetTitleMatchMode, 2
IfWinExist, Unread Mail ; The first mailbox I read
{
WinActivate
Sleep 100
WinMaximize
}
else
{
IfWinExist, Inbox-xxxxxxxx ; The 2nd mail box I read (replace xxxxxxx as needed so it matches your screen)
{
WinActivate
Sleep 100
WinMaximize
}
else
{
}
}
}
Who is online
Users browsing this forum: No registered users and 313 guests