Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2012/5.0 > C# 2012/5.0 General Discussion
| Search | Today's Posts | Mark Forums Read
C# 2012/5.0 General Discussion Discussions about the C# 2012 language and tool not related to any specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2012/5.0 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 15th, 2018, 12:46 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
  #2 (permalink)  
Old November 20th, 2018, 01:43 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by aabhi View Post
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
  #3 (permalink)  
Old March 23rd, 2019, 03:23 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2019
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
  #4 (permalink)  
Old June 3rd, 2019, 08:37 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2019
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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/


Similar Threads
Thread Thread Starter Forum Replies Last Post
facing cross domain issue in IE sudhansu BOOK: Professional XMPP Programming with JavaScript and jQuery 1 November 30th, 2012 12:21 PM
Not sure Excel issue or Batch file issue - Application.Workbooks("Book2.xls").Close justinferns Excel VBA 3 October 4th, 2011 03:09 PM
Issue Opening Form in Access 2007 Laurel Access 0 July 20th, 2007 03:59 PM
file opening jain_mj Visual C++ 0 November 4th, 2005 10:42 AM





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