Adding Multiple PST files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a bone-head user that has 33 PST's at 700Mb each; yeah, a real
bone-head!
Anyway; I need to add the PST's everytime I have to reset his profile. As he
has so many PST's, this happen regularly; is there a way to script or batch
the adding of the PST's without using the "Send keys" method? because of the
over-all size, PST backup is not an option.
I am tired of Microsoft's answer: add them one-by-one!


Thanks in advance
Regards,
Geoff
 
Two approaches:

1) If you want to write a script that he can run after Outlook starts, you
can use the Namespace.AddStore method.

2) Create and store a .prf file with his desired settings.

Have you thought about upgrading him to Outlook 2003, where the default
maximum size for a new .pst is 20GB?
 
Does 20Gb fit on a CD? Not very praticle until 20 Gig DVD's come out.

Will investigate both suggestions, thanks.
 
I'm new at this (newbie), and only really written scripts that work by "send
keys" method.
I have looked at your site and the example below is alien to me. Can you
tell me where to put the path and file name (basically the syntax).
I would also like to grap all the files in a directory if it is possible.

Sub SetNewStore(strFileName as String, strDisplayName as String)
Dim objOL as Outlook.Application.
Dim objNS as Outlook.Namespace
Dim objFolder as Outlook.MAPIFolder

Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
objNS.AddStore strFileName
Set objFolder = objNS.Folders.GetLast
objFolder.Name = strDisplayName

Set objOL = Nothing
Set objNS = Nothing
Set objFolder = Nothing
End Sub
 
You would call this sub from another procedure, passing the filename and
display name as arguments:

Sub MakeAnotherPST()
Call SetNewStore("C:\pst45.pst", "Yet another PST")
End Sub

You can call SetNewStore as many times as you need to from the
MakeAnotherPST procedure. Just add another statement with another PSt as the
argument.

These are existing PSTs, right? In that case, you don't need to mess around
with the display name. Comment out the GetLast and DisplayName statements by
putting an apostrophe at the beginning of the line.

But what I'd recommend is that you just adapt my code to a simple procedure
with one AddStore line for each .pst file. The single argument for AddStore
is the path to the .pst file:

Sub SetNewStores()
Dim objOL as Outlook.Application.
Dim objNS as Outlook.Namespace
Dim objFolder as Outlook.MAPIFolder

Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
objNS.AddStore "C:\onepst.pst"
objNS.AddStore "C:\anotherpst.pst"

Set objOL = Nothing
Set objNS = Nothing
Set objFolder = Nothing
End Sub

Be sure you take all the credit for making this user's life easy. They at
least owe you lunch.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top