Sign in to follow this  
Followers 0
sandyd

Detecting new mail icon

7 posts in this topic

Hi all,

Any ideas on how to pop up a message box when new mail arrives in outlook 2003.

I know a notification exists alreadty, but it wont alert for messages into another mailbox, only the main inbox.

What I was thinking was to detect when the new mail notification envelope appears and use that to trigger the message.

Any other ideas are more than welcome.


----[ SandyD ]---

Share this post


Link to post
Share on other sites



How about an auto-forwarding rule on the silent inbox, to the one that pops up the notification?

Share this post


Link to post
Share on other sites

Good idea, but then I would have a copy of that email in my own mailbox and would just have to delete it.

Would prefer a cleaner solution


----[ SandyD ]---

Share this post


Link to post
Share on other sites

Hi all,

Any ideas on how to pop up a message box when new mail arrives in outlook 2003.

I know a notification exists alreadty, but it wont alert for messages into another mailbox, only the main inbox.

What I was thinking was to detect when the new mail notification envelope appears and use that to trigger the message.

Any other ideas are more than welcome.

You could use COM automation to remotly control Outlook and to check yourself if there is a new message in the inbox. Google: outlook 2003 automation vba

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

A few things here.

I wish to have a notification script for my Outlook here at work. unfortunately, i think it sends the notification before it filters it, so when I get the mass spam from servers and the likes I have them filter straight to the deleted items folder. I want notifications for items that are only filtered to my inbox. I have looked through the options for any options related to this and cannot find anything other than the option to notify or not notify.

will COM objects help me solve this? how long will it take little 'ol me to learn the ins and outs of COM?


Amp Energy Drink: the official sponsor of me scripting at 2AM.

Share this post


Link to post
Share on other sites

Hi Mike,

I figured this out but not by using autoit.

You will have to write an outlook macro like below, and store it in the ThisOutSession part of the module:

Private WithEvents colItems As Outlook.Items 

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

End Sub

Private Sub Application_Startup()
  Dim oTop As Outlook.MAPIFolder
  Dim oFolder As Outlook.MAPIFolder
  Dim oNS As Outlook.NameSpace

  Set oNS = Application.GetNamespace("MAPI")

  Set oTop = oNS.Folders.Item("Mailbox - TSV IT Services")
  Set oFolder = oTop.Folders.Item("Inbox")
  Set colItems = oFolder.Items
  
End Sub

Private Sub colItems_ItemAdd(ByVal Item As Object)
    MsgBox "New Message in TSV IT Services"
End Sub

Just replace the "Mailbox - TSV IT Services" with the mailbox you want and the "Inbox" with the folder you want to monitor.

Let me know how you get on.


----[ SandyD ]---

Share this post


Link to post
Share on other sites

I'm not going to lie, I haven't the first clue what to do. I opened MVB under Tools>Macros and pasted that code wherever I could but it wouldnt see any macros. :P


Amp Energy Drink: the official sponsor of me scripting at 2AM.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0