Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / May 2008

Tip: Looking for answers? Try searching our database.

pst file parsing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
krazymike - 27 May 2008 17:17 GMT
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!!!!

mevering@thompsoncoburn.com
Dmitry Streblechenko - 27 May 2008 17:34 GMT
Use RDOSession.LogonPstStore or, if you are using an existing profile,
RDOSession.Logon/RDOSession.Stores.AddPstStore

Signature

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-

>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.
[quoted text clipped - 6 lines]
>
> mevering@thompsoncoburn.com
krazymike - 27 May 2008 17:50 GMT
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!!!

On May 27, 11:34 am, "Dmitry Streblechenko" <dmi...@dimastr.com>
wrote:
> Use RDOSession.LogonPstStore or, if you are using an existing profile,
> RDOSession.Logon/RDOSession.Stores.AddPstStore
[quoted text clipped - 14 lines]
>
> > mever...@thompsoncoburn.com
Dmitry Streblechenko - 27 May 2008 18:24 GMT
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

Signature

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?
[quoted text clipped - 24 lines]
>>
>> > mever...@thompsoncoburn.com
krazymike - 27 May 2008 19:23 GMT
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

On May 27, 12:24 pm, "Dmitry Streblechenko" <dmi...@dimastr.com>
wrote:
> Which folders do you need?
> Start with the root folder visible to the user (RDOStore.IPMRootFolder) and
[quoted text clipped - 37 lines]
>
> >> > mever...@thompsoncoburn.com
krazymike - 27 May 2008 19:44 GMT
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
krazymike - 28 May 2008 18:28 GMT
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

> ok, i got it to work.
>
[quoted text clipped - 9 lines]
>     Next
> End Sub
krazymike - 28 May 2008 19:20 GMT
Got it.

Mid(m.Parent.FolderPath, 2) 'm is the RDOMail object

> 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
[quoted text clipped - 19 lines]
> >     Next
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.