none
crash when trying to access folders RRS feed

  • Question

  • i tried to run my application in a different computer and i received a crash:

    Microsoft.Office.Interop.Outlook.Application outlookApp;
    Microsoft.Office.Interop.Outlook.NameSpace session;
    Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder;
    
    outlookApp = new Microsoft.Office.Interop.Outlook.Application();
    session = outlookApp.Session;
    mail = session.Accounts[1].SmtpAddress;
    folders = session.Folders[mail];

    Here I'm getting the following error:

    Error: Connection Failure Exception

    Exception message: The operation failed. An object could not be found.

    Exception stack trace:    at Microsoft.Office.Interop.Outlook.FoldersClass.get_Item(Object Index)

       at TestOutlookConnection.TestConnection.StartTestConnection()

    can someone helps me?

    tnx,

    shiran



    • Edited by redgolda Thursday, October 4, 2012 1:38 PM
    Thursday, October 4, 2012 1:38 PM

All replies

  • Are you sure that the user's folder structure in their Outlook has a top level folder, mailbox or PST file named for their SMTP address?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "redgolda" <=?utf-8?B?cmVkZ29sZGE=?=> wrote in message news:93e4de9d-f65d-461c-91e2-878f979a2ef0...

    i tried to run my application in a different computer and i received a crash:

    Microsoft.Office.Interop.Outlook.Application outlookApp;
    Microsoft.Office.Interop.Outlook.NameSpace session;
    Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder;
    
    outlookApp = new Microsoft.Office.Interop.Outlook.Application();
    session = outlookApp.Session;
    mail = session.Accounts[1].SmtpAddress;
    folders = session.Folders[mail];

    Here I'm getting the following error:

    Error: Connection Failure Exception

    Exception message: The operation failed. An object could not be found.

    Exception stack trace:    at Microsoft.Office.Interop.Outlook.FoldersClass.get_Item(Object Index)

       at TestOutlookConnection.TestConnection.StartTestConnection()

    can someone helps me?

    tnx,

    shiran




    Ken Slovak MVP - Outlook
    Thursday, October 4, 2012 3:12 PM
    Moderator