AnsweredAssumed Answered

Try to open MS Outlook OST file in C#

Question asked by Claire Divas on Nov 16, 2018
Latest reply on Nov 16, 2018 by Mario Zahren

I’m asking here this question because I’m getting no responses on other several C# forums.

I have a C# application in which I’m trying to open OST file. After initialization of all functions, file path, file name and root folder. During testing of C# application error occur. First time I have seen weird error. To resolve this weird error, I have changed the source code and restarted the application again. While starting the application, same error again occur.


The code which I have used in C# is:


Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();


NameSpace outlookNs = app.GetNamespace("MAPI");

// Add PST file (Outlook Data File) to Default Profile


  • outlookNs.AddStore(pstFilePath);


MAPIFolder rootFolder = outlookNs.Stores[pstName].GetRootFolder();


Folders subFolders = rootFolder.Folders;



I have tried to search problem regarding OST file in C# over this forum but can’t find any question.


After using Google, I have found few approaches. In these approaches lots of coding involved. Probably this may solve problem.


Please suggest, which approach is better than other approaches.