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

link|improve this question
feedback

2 Answers

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.

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

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.