My app fails when calling Outlook.Namespace.Folders

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ryan H

    My app fails when calling Outlook.Namespace.Folders

    I made a program that reads emails from an Outlook mailbox and does some
    stuff and the program works fine.
    However, my boss now tells me that the program is to be executed from a
    remote computer. I now get the following error when calling the program
    remotely:

    "Could not complete the operation because the service provider does not
    support it. at Outlook.NameSpa ceClass.get_Fol ders()
    For more information, see Help and Support Center at
    http://go.microsoft.co m/fwlink/events.asp."


    Below is the piece of code in the program where the error occurs:

    ' Create Outlook application
    Dim loApp As Outlook.Applica tion = New Outlook.Applica tion

    ' Get Mapi NameSpace
    Dim loNS As Outlook.NameSpa ce = loApp.GetNamesp ace("MAPI")

    ' Error occurs here
    Dim loFol As Outlook._Folder s = loNS.Folders


    How do I fix this?


  • Alvin Bruney [ASP.NET MVP]

    #2
    Re: My app fails when calling Outlook.Namespa ce.Folders

    A couple of things to look at here:
    1.
    Outlook requires authentication before being called. If you don't
    impersonate or create credentials, the process running your application will
    be used to present credentials to Outlook. Those credentials must be able to
    authenticate against outlook. In your first instance, the logged on user is
    being used to authenticate outlook by default so you likely won't see any
    issue.

    2.
    You could also be running into the Outlook object model guard.

    3.
    The supported technology for interacting with outlook is WebDav.

    --
    Regards,
    Alvin Bruney

    Want a free copy of VS 2008 w/ MSDN premium subscription?
    Details at http://msmvps.com/blogs/alvin/Default.aspx

    Auther Plug
    OWC Blackbook now on download at www.lulu.com/owc

    "Ryan H" <rherrera@smci. comwrote in message
    news:#qprqu#JJH A.1304@TK2MSFTN GP02.phx.gbl...
    I made a program that reads emails from an Outlook mailbox and does some
    stuff and the program works fine.
    However, my boss now tells me that the program is to be executed from a
    remote computer. I now get the following error when calling the program
    remotely:
    >
    "Could not complete the operation because the service provider does not
    support it. at Outlook.NameSpa ceClass.get_Fol ders()
    For more information, see Help and Support Center at
    http://go.microsoft.co m/fwlink/events.asp."
    >
    >
    Below is the piece of code in the program where the error occurs:
    >
    ' Create Outlook application
    Dim loApp As Outlook.Applica tion = New Outlook.Applica tion
    >
    ' Get Mapi NameSpace
    Dim loNS As Outlook.NameSpa ce = loApp.GetNamesp ace("MAPI")
    >
    ' Error occurs here
    Dim loFol As Outlook._Folder s = loNS.Folders
    >
    >
    How do I fix this?
    >

    Comment

    • Brian Tillman [MVP - Outlook]

      #3
      Re: My app fails when calling Outlook.Namespa ce.Folders

      "Ryan H" <rherrera@smci. comwrote in message
      news:%23qprqu%2 3JJHA.1304@TK2M SFTNGP02.phx.gb l...
      >I made a program that reads emails from an Outlook mailbox and does some
      >stuff and the program works fine.
      Programming questions belong in microsoft.publi c.outlook.progr am_vba or
      ..program_addin s
      --
      Brian Tillman [MVP-Outlook]

      Comment

      Working...