Solved

Outlook IMAP folders doesn't update Unread message count.

Posted on 2008-06-09
14
4,615 Views
Last Modified: 2011-10-19
I have Outlook 2003 with an Exchange account and an IMAP account defined.  When a new message arrives in the IMAP Inbox, the unread message count does not increment and the Inbox label does not change to bold.  The Exchange Inbox functions as expected.

I have to manually check the IMAP inbox to see if new messages arrived.

Thoughts?  Suggestions?  Thanks.
0
Comment
Question by:snowdog_2112
  • 5
  • 2
  • 2
  • +2
14 Comments
 
LVL 28

Expert Comment

by:peakpeak
Comment Utility
That is because the default check interval is 30 minutes. Change it in Tools->Options->Configure e-mail->Send and receive (translated)
0
 

Author Comment

by:snowdog_2112
Comment Utility
The Send/Rcv was already set at 5 minutes.

Let me clarify.  I am receivng mail in the IMAP folder.  New messages are coming in to the Inbox.  I can see them as new messages (i.e., they are bolded in the Inbox).  But when the messages come in, the unread message count does not increment on the Inbox folder on the left navigation bar.

Again, the mail comes in and shows as new mail in the Inbox, but the Inbox folder does not change appearance, so I have to manually expand the Inbox in the IMAP folders to see if there really is any new mail.  This is inconvenient since I leave the Exchange Inbox open to watch new mail from the Exchange server.

Thanks.
0
 

Expert Comment

by:Inbox360
Comment Utility
i have the same problem, any answer?  all my folder under inbox do not show a new blue number count when there is mail moved into them when using imap with gmail in outlook 2003
0
 
LVL 2

Accepted Solution

by:
wackym earned 0 total points
Comment Utility
A solution/hack to this problem:
Replace "Inbox at somewhere@somplace.com" with whatever is the name of the imap inbox folder (oh, and the folder must be in Favorites group...or you'll have to change the macro to compensate).
Copy macro to new project in "ThisOutlookSession". Sign it with certificate. You can create certificate with selfcert.exe application which you should find in C:\Program Files\Microsoft Office\Office12 or similar. After that, restart Outlook, accept created certificate as trusted and the macro should run on every send/recieve.

' Macro

Dim objNavFolder As NavigationFolder

Public WithEvents folderItems As Outlook.Items
 

Private Sub Application_Quit()

    Set objNavFolder = Nothing

    Set myOlItems = Nothing

End Sub
 

Private Sub Application_Startup()
 

    Dim objNamespace As NameSpace

    Dim objFolder As Folder

    

    Dim objPane As NavigationPane

    Dim objModule As MailModule

    Dim objGroup As NavigationGroup
 

    On Error GoTo ErrRoutine
 

    Set objPane = Application.ActiveExplorer.NavigationPane

    Set objModule = objPane.Modules.GetNavigationModule(olModuleMail)

    Set objGroup = objModule.NavigationGroups.GetDefaultNavigationGroup(olFavoriteFoldersGroup)
 

    ' replace "Inbox at somewhere@somplace.com" with proper folder

    Set objNavFolder = objGroup.NavigationFolders.Item("Inbox at somewhere@somplace.com")
 

    Set folderItems = objNavFolder.Folder.Items

    

    objNavFolder.Folder.ShowItemCount = olShowUnreadItemCount

    

EndRoutine:

    On Error GoTo 0

    Set objFolder = Nothing

    Set objGroup = Nothing

    Set objModule = Nothing

    Set objPane = Nothing

    Set objNamespace = Nothing

    Exit Sub
 

ErrRoutine:

    MsgBox Err.Number & " - " & Err.Description, vbOKOnly Or vbCritical, "CreateImportantFavoritesFolder"

End Sub
 

Private Sub folderItems_ItemAdd(ByVal Item As Object)

    If objNavFolder <> Nothing Then

        objNavFolder.Folder.ShowItemCount = olShowUnreadItemCount

    End If

End Sub

Open in new window

0
 
LVL 2

Expert Comment

by:wackym
Comment Utility
The question should not be deleted because it adresses an issue that is still present in outlook 2007. My answer offers a fix which I haven't found anywhere else. I don't need any points for it but I do think it's a valuable resource.

Thank you.
0
 

Author Comment

by:snowdog_2112
Comment Utility
For the record...I did not try this solution, nor did I accept the solution as the correct answer.  I'm not sure how it got accepted as the answer.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 28

Expert Comment

by:peakpeak
Comment Utility
Why do you need the unread count? The inbox should ALWAYS be empty, processed ...
0
 
LVL 2

Expert Comment

by:wackym
Comment Utility
@peakpeak
If you have more than one email account...which in these days is quite common. Unread count is needed so you don't have to manually check every folder if new mail arrived. For POP acounts it's no problem but for IMAP accounts Outlook neglects to refresh the status (unread count) of the folder, hence the hack.
0
 

Expert Comment

by:jlwood949
Comment Utility
WackyM,

What library does the type NavigationFolder come from?  On my system, that is throwing a "user defined type not defined" error when I compile it.
0
 
LVL 2

Expert Comment

by:wackym
Comment Utility
@jlwood949
Where are you compiling it? it's a VBA macro specifically for Outlook... NavigationFolder comes from Namespace: Microsoft.Office.Interop.Outlook    Assembly: Microsoft.Office.Interop.Outlook (in microsoft.office.interop.outlook.dll)

Btw, I made a little mistake in code
line 46:     If objNavFolder <> Nothing Then     should be      If objNavFolder <> Null Then

Maybe that's the cause of your problem.

Greets.
0
 

Expert Comment

by:jlwood949
Comment Utility
@WackyM
When I start Outlook, I get this error as well when it tried to compile the macro to run it.  I was just uding the Debug menu item Compile Project1 to reproduce the error and try and troubleshoot.  I'm not finding this type in my Office11.  The only type that I even see in mine which contains the word Navigation is the olNavigationPane which is part of olPane.  I say this because I noticed in your text in the accepted answer you used Office12 as an example.  Could it be that the type is different in Office11 to which is what the original question was in reference?

I attached a screenshot so you can see where I'm compiling it.. and the structure in VBA.
NavigationFolderError.jpg
0
 
LVL 2

Expert Comment

by:wackym
Comment Utility
@jlwood949
Yes, the upper code seems to only work for office 2007. Try the code bellow. It should work for you. :)
Dim objNavFolder As Outlook.MAPIFolder

Public WithEvents folderItems As Outlook.Items
 

Private Sub Application_Quit()

    Set objNavFolder = Nothing

End Sub
 

Private Sub Application_Startup()

    On Error GoTo ErrRoutine

    

    Set objNavFolder = Application.ActiveExplorer.Session.Folders.Item("imap.gmail.com").Folders.Item("BB Alerts")

    

    If objNavFolder <> Null Then

        objNavFolder.ShowItemCount = olShowUnreadItemCount

    End If

    

    Exit Sub
 

ErrRoutine:

    MsgBox Err.Number & " - " & Err.Description, vbOKOnly Or vbCritical, "Error"

End Sub
 

Private Sub folderItems_ItemAdd(ByVal Item As Object)

    On Error GoTo ErrRoutine

    If objNavFolder <> Null Then

        objNavFolder.ShowItemCount = olShowUnreadItemCount

    End If

End Sub

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
Use email signature images to promote corporate certifications and industry awards.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now