Jul 112011
 

I recently posted about a particular Service Pack 1 improvement for Outlook 2010 at:

I can confirm that the other issue of “Your IMAP server closed the connection” messages is still there. Therefore I have reactivated the following AutoHotkey scrip:

#NoEnv ; standard AutoHotkey header

SendMode Input ; standard AutoHotkey header

SetWorkingDir %A_ScriptDir% ; standard AutoHotkey header

Loop

{

sleep 50

IfWinExist Microsoft Outlook, Your IMAP server closed the connection

{

WinClose

}

}

I wish Microsoft could handle this error message in a more graceful manner than just putting up the error message and sitting there not doing anything except waiting for user input. Outlook should retry the connection and perhaps also put a message in the status area at the bottom of the Outlook window.

System config: Windows 7 Ultimate 64-bit, Outlook 2010 (32-bit)

Article by Kulvinder Singh Matharu – 2011

Jun 302011
 

I recently installed Service Pack 1 for Microsoft Office 2010. I immediately noticed something different In Outlook 2010 when IMAP e-mails arrive….

The previous version of Outlook 2010 did not provide proper notification of new e-mails arriving via IMAP. I wrote an AutoHotkey script to get around this problem:

Outlook 2010 with Service Pack 1 now seems to provide proper notification in the Notification Area in Windows 7 and also changes the display of the Outlook icon on the Taskbar; the way it is supposed to work as per arrival of e-mails via POP3.

So I’ve now retired that particular AutoHotKey script; it was brilliant.

As descried in the link above, the other issue I had with the previous version of Outlook 2010 was that it would occasionally throw-up “Your IMAP server closed the connection” error messages. I haven’t seen this error with Outlook 2010 Service Pack 1 but it’s still early days. I’m monitoring the situation.

System config: Windows 7 Ultimate 64-bit, Microsoft Office 2010 (32-bit) Service Pack 1.

Article by Kulvinder Singh Matharu – 2011

Jan 032011
 

[There is now an update at http://www.metalvortex.com/blog/2011/06/30/617.html]

I recently changed Outlook 2010 from my POP3 account to an IMAP account with Google. When I first initialised Outlook 2010 it took a very long time for all the folders to by synched. But once this initial synchronisation was completed further sync actions were quite rapid so I was quite pleased with that especially with others reporting slow continuous IMAP sync times.

However, there was one problem; Outlook 2010 does not provide a notification message for arrival of new mail via IMAP. That seemed to be an easy one to fix; I set up an Outlook rule to provide a notification for arrival of new emails for the IMAP account. This was a partial success. The notification window only stays on the screen for a few seconds before disappearing, the Outlook taskbar icon does not change, and the Outlook SysTray icon also does not change (the Outlook SysTray icon is hidden on my system anyway).

What this means is that if I am away momentarily and return to the PC I have no way of determining if new mail has been received except by manually switching to the Outlook window. Not ideal. But I had a solution; AutoHotkey.

I actually already use AutoHotkey to automate some tasks on my system so I hoped to be able to generate a pop-up window when new mail arrives. This pop-up window would appear on the taskbar and also on the SysTray if I so wished. This was successful. I created an .EXE file from the following AutoHotkey script:

#NoEnv ; standard AutoHotkey header

SendMode Input ; standard AutoHotkey header

SetWorkingDir %A_ScriptDir% ; standard AutoHotkey header

MsgBox, 1, New mail notification, Switch to Outlook?

IfMsgBox OK

{

GroupAdd, newmail, New mail notification ahk_class #32770

WinClose, ahk_group newmail

IfWinExist, Inbox – ahk_class rctrl_renwnd32

{

WinActivate, Inbox – ahk_class rctrl_renwnd32

}

else

{

Run outlook

WinWait Inbox – ahk_class rctrl_renwnd32

WinActivate Inbox – ahk_class rctrl_renwnd32

}

}

else

{

GroupAdd, newmail, New mail notification ahk_class #32770

WinClose, ahk_group newmail

}

The .EXE is executed by an Outlook rule whenever new mail arrives. Works a treat.

new mail notification

new mail notification

Note that selecting “OK” or “Cancel” will result in the closure of all .EXE notification windows. I chose a nice envelope icon for the .EXE file. You can choose some great ones from these two sites:

Once I got that working I found another problem. Sometimes Outlook would throw up an error that the IMAP server closed the connection.

Outlook IMAP error

Outlook IMAP error

This error message would be just sitting there and I would not know about it unless I switched to Outlook. AutoHotkey came to my rescue again. I actually had to use two scripts. This is the main script called IMAP_ERROR.ahk:

#NoEnv ; standard AutoHotkey header

SendMode Input ; standard AutoHotkey header

SetWorkingDir %A_ScriptDir% ; standard AutoHotkey header

Loop

{

sleep 50

IfWinExist Microsoft Outlook, Your IMAP server closed the connection

{

WinClose

}

}

I’m keeping an eye out on the IMAP error messages to determine if other error messages are being generated; if they are then I will need to change the text matching for IfWinExist. Note that the sleep command is needed to stop the infinite loop from consuming all your CPU cycles.

The other change I made was to put the following code into AutoHotkey.ahk so that the above script would always be called-up and sit there waiting:

DetectHiddenWindows On

SetTitleMatchMode 2

WinClose IMAP_ERROR.ahk – AutoHotkey

run C:\Utils\scripts\IMAP_ERROR.ahk

So far everything seems to be working as required. The code list here is quite basic and I probably need to add better error-handling and undertake some code-optimisation, but at the moment the code is fine and should assist anyone else who’s having similar problems. Hopefully the next version of Outlook will have better handling of IMAP and error messages. And thank you AutoHotkey for making this so easy to solve!

System config: Windows 7 Ultimate 64-bit, Outlook 2010 (32-bit)

[There is now an update at http://www.metalvortex.com/blog/2011/06/30/617.html]

Article by Kulvinder Singh Matharu – 2011