pst file parsing

  • Thread starter Thread starter krazymike
  • Start date Start date
K

krazymike

I just need to navigate through a .pst (actually 109 .pst files) and
extract the to:, from:, and cc: field values into a access database.
I have the code to process multiple .msg files, so the adaptation
should be rather simple. I have redemption, but it seems to only want
to connect to my Outlook account. I need to connect to a pst by
filepath and then do the extraction.

Please HELP!!!!

(e-mail address removed)
 
Use RDOSession.LogonPstStore or, if you are using an existing profile,
RDOSession.Logon/RDOSession.Stores.AddPstStore

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
ok, i've got the logonPstStore up. Now, how do I get the fields I
want out of the individual messages?

I probably have to get a list of the messages first, then go through
them one by one, right?

Thank you so much for your help!!!
 
Which folders do you need?
Start with the root folder visible to the user (RDOStore.IPMRootFolder) and
recursively process all teh child fodler (RDOFolder.Folders collection)
For each folder, process each message in the RDOFolder.Items collection

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
ok, here's the code I have. I can't get the fields to come up in the
getMsgs sub. It navigates through the folder tree just fine. I just
can't seem to get the fields I need from the messages.

Option Explicit
Dim j As Integer
Sub parser()
CurrentDb.Execute ("delete * from test")
Dim mySession As Redemption.RDOSession
Dim pst As RDOPstStore
Dim store As RDOStore

Dim folder As RDOFolder 'Variant
Dim folder2 As RDOFolder
Dim folder3 As RDOFolder
Dim c As New Collection
Dim i As Integer
j = 1
Set mySession = CreateObject("Redemption.RDOSession")
' Dim rs As Recordset
' Set rs = CurrentDb.OpenRecordset("test")
Set pst = mySession.LogonPstStore("c:\test.pst")
Set store = mySession.Stores(1)
Call getFolders(store.IPMRootFolder)
Set mySession = Nothing
MsgBox "all done!"
End Sub

Private Sub getFolders(fs As RDOFolder)
On Error Resume Next
Dim f As RDOFolder
Dim m As RDOItems
For Each f In fs.Folders

For Each m In f.Items
Call getMsgs(m)
Next
Call getFolders(f)
Next
End Sub

Private Sub getMsgs(m As RDOItems)

End Sub
 
ok, i got it to work.

Private Sub getFolders(fs As RDOFolder)
On Error Resume Next
Dim f As RDOFolder
Dim m As RDOMail
For Each f In fs.Folders
For Each m In f.Items
Call getMsgs(m)
Next
Call getFolders(f)
Next
End Sub
 
New (minor) issue. I would like to preserve the "path" to the current
message. I can use the .Parent property to show the folder the
message is in, but I'd like the full structure.

like Inbox\personal\hookups or whatever.

Any ideas?

ty
 
Back
Top