Quickly Querying the Contents of an Appointment (Calendar) Folder

Posted on 2007-10-14
Last Modified: 2010-04-08
I am not very familiar with the Outlook object model, but I have managed to write a program that works out all of my appointments for the next 10 days and emails them to my cell phone by looping through all appointments and collecting the ones that fit certain criteria.  It works, but because I have to loop through everything it is slow.  Is there a smarter way to achieve this goal?  For example, is there a way to perform a structured query on the contents of the appointments folder, or is there a way to sort the contents of the folder by date so that I only need to loop through a portion of the items?  Or perhaps I could interrogate the explorer, which has already worked out what's coming up in the next 10 days?

Question by:shacho
    LVL 76

    Accepted Solution

    Hi, shacho.

    Try using the Find or Restict methods of the folder's Items property.

    Author Comment

    Wow.  That's clever.  Unfortunately it did not result in a performance gain, but I pretty certain that if there were a way to do it, this would be the way.  Thanks for the tip.

    LVL 76

    Expert Comment

    by:David Lee
    You're welcome, Mike.  You should see a big performance gain over looping through all records.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Use email signature images to promote corporate certifications and industry awards.
    Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    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 …

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now