Application_NewMailEx event not firing
I am using the above event to intercept new emails so I can process them. What I am finding is that the event will not fire after the initial send/receive when you logon but is OK after that. I am using Outlook 2003 in cached exchange mode with a hosted server. Macro security is set to low.
I've tried it without being in cached mode but it is still the same and the standard NewMail event also does the same thing. I tried to use a rule to do what I want which is to return a reply email to the sender if they send their email to a particular domain, but I find that it works once and then not again until I restart Outlook, hence the reason for VBA. I suppose I could use a combination of both but that would be a real pain to setup on 30 users machines.
Anybody else had the same problem?
Re: Application_NewMailEx event not firing
You could place a manual code call to fire the Application_NewMailEx event from the Application_MAPILogonComplete event. MAPILogonComplete only fires once when Outlook starts up and never again unless you close Outlook and re-open it.
Only issue will be that the NewMailEx takes an Item or EntryID parameter.
Re: Application_NewMailEx event not firing
Unfortunately, I tried that and the MAPI logon fires before the first send/receive so there will not be any new mails to process at that point.
Looking round on the net, I think that the problem lies with the fact that when mail arrives at the server and Outlook is not connected, then when you do connect up later the mail is not considered new anymore and the event doesn't fire. Sounds about right for Microsoft logic!
Think I'm on a loser here. Thanks for the idea anyway RobDog.
Re: Application_NewMailEx event not firing
Is the Option set for "Perform a a send and receive for the group when Outlook starts" in the Options of Outook? Maybe if you turn it on it may help?
Re: Application_NewMailEx event not firing
Do you mean "Send immediately when connected", if so it was already on. I turned it off to experiment and it still did the receive part.