VBOffice

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.191  | #98
◀ Previous sample Next sample ▶
SAM SAM
Determine the "identity" of your emails. Set with SAM the sender and the folder folder for sent items with the help of rules.

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
  DoEvents
  Set Application.ActiveExplorer.CurrentFolder = F1
End Sub
OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.
email  Send a message