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
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.