Trap the ItemAdd event for the Items collection of the Inbox. It will
provide an Item for the incoming email. See
http://www.slipstick.com/dev/code/zaphtml.htm#cw for a VBA example of
an ItemAdd handler.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Frode Lillerud" <(E-Mail Removed)> wrote in message
news:Xns946B7928ACD44publiclillerudno@217.13.9.15...
> A pseudo-code of what I want to do follows:
>
>
> public void MethodForHandlingIncomingMail(MailItem newmail)
> {
> print(newmail.body);
>
> if (body contains "spam")
> {
> //send mail to spamfolder
> }
> else
> {
> //send mail to inbox
> }
> }
>
>
>
>
> How can I get ahold of the new mail as a MailItem??