morfizm (morfizm) wrote,

Outlook Rules

For Outlook users who use nested folders.

If you're using Outlook with Exchange, and a new mail comes into nested folder, the parent folder doesn't get expanded. It's cool, because you can channel your low-priority mails into a subfolder without making them distract you.

If you're using Outlook with PST and moving e-mails with rules, parent folder will be expanded every time a new e-mail comes in. You would also run into this problem if you're using Exchange, but want to add client-only functionality to your rules (such as "mark as read").

What I tried to do is to use Outlook VBA macros and "run a script" rule. I didn't succeed much: they work intermittently and stop working at random point in time. I asked Outlook experts for advice and they told me that running a script isn't a recommended way. I should implement the whole thing using VBA, per article:

"How to create a custom rule using Visual Basic for Applications (VBA) in Outlook 2002";EN-US;292063

Public WithEvents myOlItems As Outlook.Items

Public Sub Application_Startup()
  Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub myOlItems_ItemAdd(ByVal Item As Object)
  If TypeName(Item) = "MailItem" Then
    Dim M As MailItem
    Set M = Item
    Header = M.PropertyAccessor.GetProperty("")
    If (InStr(1, M.SenderEmailAddress, "") > 0) Then
      If ((InStr(1, Header, "kuzmen - LJ Comment") > 0) _
          And (InStr(1, M.Subject, "Comment you posted...") > 0) _
          And (InStr(1, M.Subject, "Comment you edited...") > 0)) Then
        M.UnRead = False
        M.Move Application.GetNamespace("MAPI").Folders.Item("DK").Folders.Item("Archive")
        M.Move _
      End If
    End If
  End If
End Sub
What it does is it moves my own comments into "Archive" folder and marks them as read, and moves everything else into "LJ" subfolder under "Inbox", without expanding "Inbox".


  • Освобождение от NAS и переход на клауд - 2

    Я придумал концептуальную схему, которая позволит устранить основные bottlenecks - необходимость время от времени перезаливать в клауд "сразу всё" -…

  • Освобождение от NAS и переход на клауд

    Процесс очень активен, но, к сожалению, всё значительно труднее, чем я думал. 1. Консьюмерские клауд-storage-провайдеры не справляются с большим…

  • A:

    Наконец, переборол сопротивление инерции и дал букву A: архивному диску (А - Архив). Нет, флоппиков больше не будет, можно, наконец, оставить все…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.