In that scenario, you could also add a "run a script" action to the rule. A "run a script" rule action takes a MailItem or MeetingItem as its parameter, then uses that item in the code:
Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMail = olNS.GetItemFromID(strID)
' do stuff with olMail, e.g.
MsgBox olMail.SUbject
Set olMail = Nothing
Set olNS = Nothing
End Sub
See
http://www.outlookcode.com/d/code/zaphtml.htm#ol2002 for another example.
You may want to include the code to move the item in the VBA procedure rather than including it as a separate action on that rule. I'm not sure how well mixing rule actions and a VBA procedure will work.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Tobias R" <(E-Mail Removed)> wrote in message news:999A4DF3-61D8-4953-BCC8-(E-Mail Removed)...
> Hi Sue,
>
> thanks a lot for your quick reply.
>
> Outlook 2003, eMails are put into folder by rule (if phrase xyz is in
> subject, then move eMail in folder abc...)
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> Outlook version? Are you putting the incoming message in the folder with a rule?
>>
>> --
>> Sue Mosher, Outlook MVP
>> Author of Configuring Microsoft Outlook 2003
>> http://www.turtleflock.com/olconfig/index.htm
>> and Microsoft Outlook Programming - Jumpstart for
>> Administrators, Power Users, and Developers
>> http://www.outlookcode.com/jumpstart.aspx
>>
>>
>> "Tobias R" <(E-Mail Removed)> wrote in message news:660E6AF6-A0A2-49C7-9487-(E-Mail Removed)...
>> > Hello,
>> >
>> > I'm looking for a reliable way which automatically runs a given macro every
>> > time, a new eMail arrives in a given folder.
>> >
>> > From all I know there is the newMail event - but as far as I know it is not
>> > fully reliable.
>> >
>> > Does anyone know of any reliable alternative?
>> >
>> > Any help is greatly appreciated :-)
>> >
>> > Best regards,
>> > Tobias.
>> >
>> >
>>