Free Support Forum - aspose.com

Opening a PST file read-only

Hello,

I’m trying to use the code below for opening a PST file from a read-only filesystem, and I’m getting an error message. After some tests I found out that if I try to open from a read-write filesystem it works OK.

PersonalStorage pst = PersonalStorage.fromFile(pstFilename);

How can I open it for reading only?

Thanks

@kelberuc1,
Thank you for your request. Any PST file must not be read-only even for loading. At least a special area of the file is used to write information about reading. It is actually one of the reasons. This feature is related to Messaging Application Programming Interface (MAPI). If you try to load such file in Outlook, you will see an error message as well.

Hi @Andrey_Potapov,

I successfully managed to open a read-only PST file using the code below:

PersonalStorage pst = PersonalStorage.fromFile(pstFilename, false);

Thanks for your help

@kelberuc1,
I am sorry for misinforming you. I am glad you found that way.