PDA

View Full Version : How Can I Turn Off Outlook's 'New Mail Desktop Alerts' via VBA?



Wizard
09-30-2008, 02:32 PM
Running Outlook 2003 (so why I spent 1/2 hr looking in my Office 97 Tech Ref, I'll never know).

We have a situation where we are sending many reports via email, using an Excel macro. Sometimes, when the splitter/mailer macro is running and a new email comes in, the new mail desktop alert pops up - and crashes the Excel macro.

This happens most often when a cluster of emails (usually 'out of office' emails) come in all at once

I know how to turn the notifications off manually... Is there a way to turn the notifications off (and, later, back on) via VBA?

Thx

Demosthine
09-30-2008, 04:20 PM
Good Afternoon.

Theoretically, if you disable events at the start of the code and enable them again at the end of the code, you will not receive the New Mail Notification. I have not tried this yet, since it means accessing an EMail Server I don't have access to at the moment.


Application.EnableEvents = False

' Send EMail Messages.

Application.EnableEvents = True


Let me know if this works.
Scott

Wizard
10-01-2008, 05:53 AM
No, that only shuts events off in Excel... Outlook VBA doesn't have an 'EnableEvents' property.

dcraker
10-03-2008, 11:44 AM
Other than actually turning off your notification, it doesn't seem to be a popular subject. I even when to outlookcode.com, and searched in there. I would probably pose this question there, since that website is all about outlook.
Sorry I couldn't be much more help, maybe there is someone there that has your solution.

There is one thing that I would do if you like, I would set up a Rule to handle the "Out of Office" replies and send them to a seperate folder within the Inbox (name it Out of Office, if you like), since the new mail notification is for the Inbox only