Take the 2-minute tour ×

I would like to run some Outlook rule, which will be run than user moves a message from Inbox to some folder.

share|improve this question
add comment

2 Answers

It seems I found an answer to my own question :) I have to define the following macro and do that I want in myOlItems_ItemAdd method

Public WithEvents myOlItems As Outlook.Items

Public Sub Application_Startup()

' Reference the items in the Inbox. Because myOlItems is declared
' "WithEvents" the ItemAdd event will fire below.
 Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
 Set ee = Outlook.Session.GetDefaultFolder(olFolderInbox).Folders("MyTestFolder")
 Set myOlItems = ee.Items
End Sub

Private Sub myOlItems_ItemAdd(ByVal Item As Object)

 Debug.Print (Item.Subject)
End Sub
share|improve this answer
add comment

Outlook provides a predefined list of events that can trigger a rule to fire. If you cannot find one that will do what you want younare probably out of luck. While I suspect you can write your own COM plugin for this it is not for the average person.

share|improve this answer
Thank for the answer. Could you point me to some COM plugin sample? –  ilia May 21 '11 at 20:10
add comment

Your Answer


