Solved

Require VBScript to add data files / archive folders to Outlook 2007

Posted on 2011-03-01
2
1,038 Views
Last Modified: 2012-05-11
We have a user with several dozen pst file which we he needs to add to Outlook 2007.  There does not seem to be a way within Outlook to add more than a single data file at a time so I would like to do this via a script.

The script should add all the data files found in a folder to the logged in user's Outlook.  Can this be done?
0
Comment
Question by:canuckconsulting
[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
2 Comments
 
LVL 11

Accepted Solution

by:
Tasmant earned 500 total points
ID: 35007649
you can try this code. It seems working, I've done few tests.
Set oOutlook = CreateObject("outlook.application")
Set oNamespace = oOutlook.GetNamespace("MAPI")
Set oFso = CreateObject("scripting.filesystemobject")

'the path where you store all PST
Const oPath = "C:\MyPSTFiles"

Set oFolder = oFso.GetFolder(oPath)
For Each oFile In oFolder.Files
	If Right(LCase(oFile.Name),4) = ".pst" Then
		oNamespace.AddStore oFile.Path
	End If
Next

Open in new window

0
 

Author Closing Comment

by:canuckconsulting
ID: 35008398
Perfect thank you!
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

626 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