You are correct it's NewMailEx(0xfba7) which is call when a new mail receive
in Inbox folder. Lets forget about NewMail(0xf003) it's not related here and
it's only call when we click on File->New Mail item in outlook.
NewMailEx is called when user receives new mails in its inbox folder. Or if
user already contains some mails and we create its profile in outlook. When
we login to user NewMailEx is call which receive all existing mails(which
are on server) in outlook.
But in my outlook(user profile is created using exchange server) NewMailEx
is also called when after creating a new mail we save it, or we move an
existing mail from one folder to another.
So i still dont know by which action item_add event is called.
I think the only way(as per myknowledge) is to implement drag and drop. You
have already said it should do using windows API. I think i should implement
drag and drop in active inspector. I dont know how to do it. Is there any
link available on net?
<kenslovak@mvps.org> wrote in message
news:u34LkV$%23JHA.1488@TK2MSFTNGP03.phx.gbl...
> You've lost me completely.
> There are both NewMail() and NewMailEx() (for VB, VBA, VB.NET and C#). I
> don't do C++ but my guess is that the event with the higher index is
> NewMailEx(). However, both events should only fire when new mail is
> delivered to the default Inbox in that Outlook profile.
> If you are seeing anything else then you're seeing something that I've
> never heard of in the Outlook object model and I have no idea what's going
> on. Just look at the object model in the Object Browser in the Outlook VBA
> project to see what I'm talking about.
> NewMailEx() should only fire in case 1, never in your cases 2 & 3.
> The list of EntryID's you get from NewMailEx() lets you access each new
> mail that came in, which is what I thought we were talking about.
> >
>
> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:ufAnNM%23%23JHA.4900@TK2MSFTNGP02.phx.gbl...
> > There are 2 newmail events in application. I dont know exact functions in
> > VB. I'm using c++.
>
>> newmail(0xf003) this is call when we create a new mail in outlook
> > newmailex(0xfba7) this is call when a new mail receives in outlook for
> > following cases
> > 1. new mail receive in inbox folder
> > 2. we create a new mail and save/send it
> > 3. we move a mail from one folder to another folder
>
>> For all cases outlook first calls application_newmailex then
> > Items.ItemAdd
> >
> >> NewMailEx() gives you a delimited list of the EntryID's of items that
> >> have come in since the last time that event fired.
>
>> Please explain how EntryID's can help?
>
>> The critical case is if a exchange user has some mails already in it and
> > we create a new profile for this user in outlook and login to outlook
> > then application_newmailex and Items.ItemAdd will be call for all mails
> > which come to inbox until outlook restored all old mails.
>