p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# 2012/5.0 General Discussion (http://p2p.wrox.com/forumdisplay.php?f=714)
-   -   Facing Issue while opening .OST file in C# (http://p2p.wrox.com/showthread.php?t=100067)

aabhi November 15th, 2018 12:46 AM

Facing Issue while opening .OST file in C#
 
I’m working as a freelancer and creating different types of projects on C# language. From last few days, I’m handling a project in which I have to open .OST file in C#. For doing such things, I have written the following code:

Code:

private void CreateInboxSubFolder(Outlook.Application OutlookApp)
{
      Outlook.NameSpace nameSpace = OutlookApp.GetNamespace("MAPI");
      Outlook.MAPIFolder folderInbox = nameSpace.GetDefaultFolder(
            Outlook.OlDefaultFolders.olFolderInbox);
      Outlook.Folders inboxFolders = folderInbox.Folders;
      Outlook.MAPIFolder subfolderInbox = null;
      try
      {
            subfolderInbox = inboxFolders.Add("InboxSubfolder",
                Outlook.OlDefaultFolders.olFolderInbox);
      }
      catch (COMException exception)
      {
            if (exception.ErrorCode == -2147352567)
                //  Cannot create the folder.
                System.Windows.Forms.MessageBox.Show(exception.Message);
      }
      if (subfolderInbox != null) Marshal.ReleaseComObject(subfolderInbox);
      if (inboxFolders != null) Marshal.ReleaseComObject(inboxFolders);
      if (folderInbox != null) Marshal.ReleaseComObject(folderInbox);
      if (nameSpace != null) Marshal.ReleaseComObject(nameSpace);
}

After executing these code on C# programming, I get an error message ErrorCode=-2147352567. To sort out this error I have searched over p2p Wrox forum and found no thread.
http://p2p.wrox.com/c-c-4/

So, I have searched over the Internet and found few useful resources. But I’m confused which will fix my programming error.
https://community.hortonworks.com/qu...-language.html
https://www.nopcommerce.com/boards/t...ing-c-net.aspx
https://www.stellarinfo.com/convert-ost-to-pst.php
https://codepad.co/snippet/dyjIh4PQ

Please guide.

tonymufford@gmail.com November 20th, 2018 01:43 AM

Quote:

Originally Posted by aabhi (Post 310507)
I’m working as a freelancer and creating different types of projects on C# language. From last few days, I’m handling a project in which I have to open .OST file in C#. For doing such things, I have written the following code:

Code:

private void CreateInboxSubFolder(Outlook.Application OutlookApp)
{
      Outlook.NameSpace nameSpace = OutlookApp.GetNamespace("MAPI");
      Outlook.MAPIFolder folderInbox = nameSpace.GetDefaultFolder(
            Outlook.OlDefaultFolders.olFolderInbox);
      Outlook.Folders inboxFolders = folderInbox.Folders;
      Outlook.MAPIFolder subfolderInbox = null;
      try
      {
            subfolderInbox = inboxFolders.Add("InboxSubfolder",
                Outlook.OlDefaultFolders.olFolderInbox);
      }
      catch (COMException exception)
      {
            if (exception.ErrorCode == -2147352567)
                //  Cannot create the folder.
                System.Windows.Forms.MessageBox.Show(exception.Message);
      }
      if (subfolderInbox != null) Marshal.ReleaseComObject(subfolderInbox);
      if (inboxFolders != null) Marshal.ReleaseComObject(inboxFolders);
      if (folderInbox != null) Marshal.ReleaseComObject(folderInbox);
      if (nameSpace != null) Marshal.ReleaseComObject(nameSpace);
}

After executing these code on C# programming, I get an error message ErrorCode=-2147352567. To sort out this error I have searched over p2p Wrox forum and found no thread.
http://p2p.wrox.com/c-c-4/

So, I have searched over the Internet and found few useful resources. But I’m confused which will fix my programming error.
https://community.hortonworks.com/qu...-language.html
https://www.nopcommerce.com/boards/t...ing-c-net.aspx
https://www.stellarinfo.com/convert-ost-to-pst.php
https://codepad.co/snippet/dyjIh4PQ

Please guide.

The error is on which line exactly?. You could try to exclude NULL values and see if that works. For reference check out :

https://stackoverflow.com/questions/...020009-subform
https://www.add-in-express.com/creat...-a-new-folder/
https://social.msdn.microsoft.com/Fo...=csharpgeneral
https://www.edbmails.com/pages/ost-t...st-to-pst.html
https://www.access-programmers.co.uk...d.php?t=293137

chrisgardner750 March 23rd, 2019 03:23 AM

I understand that you are having trouble while opening .OST file in C#. In this case, you can take the help of any third party software. You can try Microsoft OST to PST converter by KDETools. With the help of this software, you can easily open OST file in just a few steps.

mattgiandalia June 3rd, 2019 08:37 AM

You can directly download wonderful OST to PST Converter which powerfully works for recovery of Outlook OST file and converts OST to PST without changing any formatting and structure of OST folders. Without creating any problem, you are capable to export all size OST files.

For more info: http://www.ost.topstconverter.com/


All times are GMT -4. The time now is 01:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.