none
Code Faulting On GetStorage RRS feed

  • Question

  •    I appear to get a valid application and folder object but the code generates and exception on the GetStorage call. The error is operation aborted.  I am able to use Outlook although it is not purchased or subscribed too. Can this be causing the problem?

                    var outApp = Marshal.GetActiveObject("Outlook.Application") as Microsoft.Office.Interop.Outlook.Application;

                    var folder = outApp.Session.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

                    var storage = folder.GetStorage("userdefined", OlStorageIdentifierType.olIdentifyByMessageClass);

    • Moved by Steve Fan Friday, April 20, 2018 2:00 AM relocate
    Thursday, April 19, 2018 7:13 AM

All replies

  • Hi,

    Welcome to the Microsoft Office for IT Professionals Outlook forum. This forum is for non-programming questions and feedback related to Microsoft Outlook. Since your question is more related to codes, I'll move it to the Outlook for Developers forum:

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,
    Steve Fan


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, April 20, 2018 2:00 AM
  • Hello mike,

    GetStorage returns an error if the store type of the folder is not supported. The following stores return an error when GetStorage is called. Please check if your folder is any of them.
    Hotmail store
    Internet Message Access Protocol (IMAP) stores
    Delegate stores
    Public folder stores

    Check below link for more information.

    Folder.GetStorage Method

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 20, 2018 2:18 AM
  • Hello mike11111111233,

    What's the state of the current issue? I note you have ever replied to the thread. Is that related to the thread?

    Has your original issue been resolved? If it has, I would suggest you mark the helpful reply as answer or provide your solution and mark as answer to close this thread. If not, please feel free to let us know your current issue.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 23, 2018 8:31 AM
  • Hello Mike,

    GetStorage returns an error if the store type of the folder is not supported. The following stores return an error when GetStorage is called:

    • Hotmail store

    • Internet Message Access Protocol (IMAP) stores

    • Delegate stores

    • Public folder stores

    Is that the case? What account/store type do you have configured in Outlook?


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Monday, April 23, 2018 10:51 AM