Hi, it's not a 100% solution to your problem but maybe will give you enough insight how to get a handle to folders and their documents.
This is a doc from IBM how to recreate your inbox folder when it is crashed.
I hope you can copy and paste some code from here to get it to work :
http://www-01.ibm.com/support/docview.wss?uid=swg21104973