Add pst, keep open for 15 minutes, then close

Posted on 2007-07-26
Last Modified: 2010-04-08
I'm trying to standardize a process in Outlook into a nicely packaged tool that can be shared with coworkers, like and add-in in Excel.  Here's what I need to be able to do with a click of a button:

- Open a shared PST archive ("J:\archive.pst")
- Keep archive open for 15 minutes
- Close archive

The only code I have to date is to open the archive:

    Dim olkNS As Outlook.NameSpace
    Set olkNS = Application.GetNamespace("MAPI")
    olkNS.AddStore "J:\archive.pst"
    Set olkNS = Nothing

Once the code is developed, how do i package it to distribute to coworkers?  Is there a solution as "neat" as an add-in (.xla file)?  Sorry for ignorance, this is my first attempt at programming in Outlook.
Question by:bacdsap
    LVL 76

    Expert Comment

    by:David Lee
    Hi, bacdsap.

    I never tried anything like what you describe, but it should be possible.  You'll need to activate a timer when the button is clicked and close the PST when the timer goes off.  As to the timer code, have a look at this question:

    To distribute this to coworkers you'll want to build an add-in.  I recommend a COM add-in.  See this page for documentation on and links to resources that'll help you with that:

    Author Comment

    Have been out of the office and not yet had time to work on this.  These both look like they could work, but i'll get back to the list as soon as possible...
    LVL 76

    Accepted Solution

    No problem.  Thanks for the update.

    Author Comment

    Unfortunately, I'm having user rights issues imposed by my employer which seem to be preventing me from even opening the VBA editior in Outlook anymore.  Additionally, I don't have VB or knowledge of any other programming languages that would enable me to produce an add-in to distribute.  In reviewing the solution however, it did seem likely that I could have used it to solve the problem, so i am awarding BlueDevilFan the points.  Thanks again!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
    My experience with Windows 10 over a one year period and suggestions for smooth operation
    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 …

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now