Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Taskbar Notification (XP)

    Hi, I have the following code in my Outlook VBA to deal with certain emails that i just want to delete as they come through:

    Private Sub myfolderIn_ItemAdd(ByVal Item As Object)
    If Item.Class = olMail Then
    If Left(Item.Subject, 10) = "Effective:" Then
    Item.UnRead = False
    Item.Delete
    End If
    End If
    End Sub

    This works fine, and any of these emails end up in my deleted items folder with an unread status. Unfotunately the 'New Mail' notification in the taskbar does not go when this code runs though. Is there a seperate method for this?

    If i go into the deleted items and select then deselect the mail the notification disappears.
    Thanks,

    pmatz

  2. #2
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Taskbar Notification (XP)

    Cool, well, i found a way around it that works. If i change the active explorer to deleted items and then back it gets rid of the notification. I guess this is a bit like 'refreshing' the screen.

    Private Sub myfolderIn_ItemAdd(ByVal Item As Object)
    If Item.Class = olMail Then
    If Left(Item.Subject, 10) = "Effective:" Then
    Item.UnRead = False
    Item.Delete
    Set ActiveExplorer.CurrentFolder = Outlook.Session.GetDefaultFolder(olFolderDeletedIt ems)
    End If
    Set ActiveExplorer.CurrentFolder = Outlook.Session.GetDefaultFolder(olFolderInbox)
    End If
    End Sub

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Thanks,

    pmatz

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Taskbar Notification (XP)

    M
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Taskbar Notification (XP)

    Hi John, thanks for the idea - it doesn't work though [img]/forums/images/smilies/sad.gif[/img]

    Strange. If I put a breakpoint in and step through the code as it is executed then the new mail notification icon doesn't show, its like the code goes too fast to trigger the event <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    Thanks,

    pmatz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •