Expand the Subfolder When a New Message Arrives

Do you sometimes miss a new email because it's automatically moved to a closed subfolder? This macro expands the subfolder so you can see at a glance whether is has new items.

Last modified: 2013/05/23 | Accessed: 39.719  | #98
◀ Previous sample Next sample ▶
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.

You can move new emails by a rule to subfolders. However, if the folder currently isn't visible in the folder list because it's collapsed, then you cannot see if it has new unread items.

This script makes the folder visible in the folder list. Copy the script to the module "ThisOutlookSession" and add the action "run a script" to the rule.

tip  How to add macros to Outlook
Public Sub ExpandFolder(Mail As Outlook.MailItem)
  Dim F1 As Outlook.MAPIFolder
  Dim F2 As Outlook.MAPIFolder

  Set F1 = Application.ActiveExplorer.CurrentFolder
  Set F2 = Mail.Parent
  Set Application.ActiveExplorer.CurrentFolder = F2
  Set Application.ActiveExplorer.CurrentFolder = F1
End Sub
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.
email  Send a message