+ Reply to Thread
Results 1 to 2 of 2

Trigger VBA code every time a new email is received in Outlook doesn't work.

  1. #1
    Forum Contributor
    Join Date
    05-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    184

    Trigger VBA code every time a new email is received in Outlook doesn't work.

    Hi Guys,

    I found the following codes online and they're supposed to work for what I need to do, but for some reason they are not working. I placed the following codes under ThisOutlookSession but for some reason only the Private Sub Application_Startup () was triggered. The Private Sub olItems_ItemAdd(ByVal item As Object) did not trigger. Can someone tell me what I did wrong?

    Please Login or Register  to view this content.


    For some reason this portion of the code didn't trigger when I received a new mail.

    Please Login or Register  to view this content.
    Also, is it possible to change this code so instead of monitoring my "Inbox" folder, can it monitors a sub folder under my Inbox folder name "MyFolder"?

    Thank you very much for your help.
    Last edited by alexduy; 01-19-2021 at 01:57 PM.

  2. #2
    Forum Contributor
    Join Date
    05-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    184

    Re: Trigger VBA code every time a new email is received in Outlook doesn't work.

    It looks like Private Sub olItems_ItemAdd(ByVal Item As Object) executed when I put in the error handler. I got a pop up message saying Error Occurred.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Read and compare subject string from new received email in Outlook
    By alexgoaga in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 08-23-2017, 04:44 AM
  2. Outlook Email Time Received
    By Frankinstyyn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2016, 11:05 AM
  3. Outlook - displaying email address received rather than display name
    By marcbarnett in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 01-19-2015, 07:36 AM
  4. Excel/Outlook 2007 vba code doesn't work in Excel/Outlook 2010
    By eveloy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2014, 10:39 PM
  5. Excel/Outlook 2007 vba code doesn't work in Excel/Outlook 2010
    By eveloy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-19-2014, 07:44 PM
  6. do something when new email is received in outlook
    By denvernuggets15 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2012, 11:34 PM
  7. Code to scrape system generated outlook email doesn't get all the data
    By bobaftt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2010, 01:57 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1