Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Read .ost file in C# programming

I’m new in C# programming. I’m using C# version 7.0 and .NET core framework. I want to read .ost file in C# programming. I have created a file and write the code. After writing code, an exception occurs “invalid shared folder”. I’m trying to sort out this issue from last 2 days but still can’t succeed.


Lines of Code:

Microsoft.Office.Interop.Outlook.

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

NameSpace objNamespace = objOutlookApplication.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.

MAPIFolder objMAPIFolder = null;

try
{

objMAPIFolder = (

MAPIFolder)objNamespace.OpenSharedFolder(@"abcsync:\\Documents\\joseph\\Local Settings\\Application Data\\Microsoft\\Outlook\\outlook.ost", null, null, null);


Folder objFolder = (Folder)objNamespace.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);

AppointmentItem objAppointmentItem = (AppointmentItem)objOutlookApplication.CreateItem(OlItemType.olAppointmentItem);

objMAPIFolder.MoveTo(objFolder);

}

catch (System.Exception e)
{

MessageBox.Show(e.Message);

}

}

I don’t understand why I’m getting this exception. I have searched this Question this site (ni.com) and I have not found any question related to my exception.

https://forums.ni.com/t5/Measurement-Studio-for-NET/bd-p/232

I’m so frustrated due to this exception. After searching a lot on C# programming forums, I have found few forums threads. Maybe it will helpful for me.

https://codes-sources.commentcamarche.net/forum/affich-10088718-comment-lire-un-fichier-pst-avec-c

https://fmforums.com/topic/103669-ost-file-in-c/

https://www.stellarinfo.com/convert-ost-to-pst.php

https://codepad.co/snippet/dyjIh4PQ

 

Which thread is helpful for my exception?

0 Kudos
Message 1 of 1
(2,084 Views)