How to : read outlook profile and find path of PSTs

  • Thread starter Thread starter FE
  • Start date Start date
F

FE

Guys,
I need to create a program (VB) to dump the outlook profile of a user.

By dump I mean a report such as :

User : Mr A
* Folder 1 : exchange mailbox
* Folder 2 : c:\data\pst1.pst
* Folder 2 : c:\data\pst2.pst

I have no problem to do this with the outlook component, except that I don't
find any property find the path of the PST (c:\data\pst1.pst)

I have no idea if the outlook component can do that. Any idea ? If there
is already a tool to do that, please inform me
Thanks
--
FE
 
AFAIK, it isn't directly exposed via any object available to VB; you can
always scan the registry and read the info there.

It is possible to get it via the StoreID property of the folders but the
value is buried inside a hex string and you'd have to pull that apart
yourself:

Private Sub Main()
Dim o As Outlook.Application
Dim n As NameSpace
Dim f As MAPIFolder
Dim s As String
Dim x As Long
Set o = CreateObject("outlook.application")
Set n = o.GetNamespace("MAPI")
n.Logon
For Each f In n.Folders
Debug.Print f.Name
s = f.StoreID
Debug.Print s
For x = 1 To Len(s) - 1 Step 2
Debug.Print Chr$("&H" & Mid$(s, x, 2));
Next
Debug.Print
Next
n.Logoff
Set n = Nothing
Set o = Nothing
End Sub
 
Back
Top