Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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