Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Outlook VBA to check if a new file is added to an outlook folder since last check?

Posted on 2010-09-02
5
Medium Priority
?
375 Views
Last Modified: 2012-05-10
How can I make outlook vba check if a new file is added to an outlook folder or not?
0
Comment
Question by:awesomejohn19
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 33590924
Thinking slightly differently - how about detecting the addition of an item to a folder directly?

Chris
0
 

Author Comment

by:awesomejohn19
ID: 33590950
Thanks,

I guess that's ok too. How would we achieve that? :)
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 33590951
The following in thisOutlookSession for example will trigger whenever something is added to the inbox.

Chris
Public WithEvents olkInbox As Outlook.items

Private Sub Application_Startup()

    Set olkInbox = Session.GetDefaultFolder(olFolderCalendar).items

End Sub

Sub olkInbox_ItemAdd(ByVal Item As Object)
    msgbox "Item Added:> " & item.subject
End Sub

Open in new window

0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 2000 total points
ID: 33590961
The startup sub needs to be triggered to enable it to work ... and is run whenever outlook restarts - or you can simply run it the first time, and from then on it;'s triggered whenver an item is added.  Of course pretty much any folder can be processed in this way.

Chris
0
 

Author Comment

by:awesomejohn19
ID: 33590965
cool thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question