Retrieving OL Calendar items from ASP.NET ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruno Vignola

    Retrieving OL Calendar items from ASP.NET ...

    Good Morning all,

    I need to interoperate with the Calendar of MS Outlook 2003
    (inserting, retrieving,
    listing events, etc. etc.) from an ASP.NET application; I first
    developed a simple
    windows application in C# and it worked fine, I added the OL reference
    and created
    the COM object with the following code:

    Outlook.Applica tion app = new Outlook.Applica tion();
    Outlook.MAPIFol der folder =
    app.GetNamespac e("MAPI").GetDe faultFolder(Out look.OlDefaultF olders.olFolder Calendar);
    System.Collecti ons.IEnumerator ie = folder.Items.Ge tEnumerator();
    ....

    The problem is that, when I write the *same* code into an ASP.NET app,
    *in spite
    of in debugging mode everything works* (I use MS VS 2008), when I
    deploy my
    app on IIS (on the same developing machine!) I always get the
    following error:

    Retrieving the COM class factory for component with CLSID
    {0006F03A-0000-0000-C000-000000000046} failed due to the following
    error: 80080005.
    Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code.
    Exception Details: System.Runtime. InteropServices .COMException:
    Retrieving the COM class factory for component with CLSID
    {0006F03A-0000-0000-C000-000000000046} failed due to the following
    error: 80080005.
    .....

    I tried almost everything, setting all the possible user and
    permissions, using
    DCOMCNFG, etc. looking on the net and it seems that many people have
    the
    same problem, but no solutions ...

    Is it possible to create a COM object instance (CoCreateInstan ce)
    inside an
    ASP.NET app ?

    Thank you in advance for your help ...

    Bruno
  • Mark Rae [MVP]

    #2
    Re: Retrieving OL Calendar items from ASP.NET ...

    "Bruno Vignola" <bruno.vignola@ gmail.comwrote in message
    news:e3f2f35c-046c-4bbe-835d-f41447c5ca4c@l4 3g2000hsh.googl egroups.com...
    Outlook.Applica tion app = new Outlook.Applica tion();
    >
    The problem is that, when I write the *same* code into an ASP.NET app,
    >
    I always get the following error:
    <snip>

    Yes, that is one of the (many) errors that you are likely to get in this
    situation...
    Is it possible to create a COM object instance (CoCreateInstan ce)
    inside an ASP.NET app ?
    Yes it is, so long as the COM object that you are tying to instantiate is
    designed to be instantiated in this way.

    Microsoft Office isn't designed to be instantiated in this way. In fact,
    Microsoft do not recommend this type of server-side Office automation at
    all, and won't support any solution which attempts to use it:



    Presumably, the local copies of Microsoft Outlook are all using Microsoft
    Exchange Server? If so, then you will need to code your ASP.NET solution to
    interrogate Exchange instead. This is not particularly difficult, and there
    are hundreds of examples on the web:



    --
    Mark Rae
    ASP.NET MVP


    Comment

    • Bruno Vignola

      #3
      Re: Retrieving OL Calendar items from ASP.NET ...

      On 22 Set, 13:43, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:

      Hello Mark,
      Microsoft Office isn't designed to be instantiated in this way.
      I supposed that ... :-( .. I read that Microsoft do not recommend that
      solution.
      Presumably, the local copies of Microsoft Outlook are all using Microsoft
      Exchange Server?
      yes they do, it is the server of my company.
      If so, then you will need to code your ASP.NET solution to
      interrogate Exchange instead. This is not particularly difficult, and there
      are hundreds of examples on the web:http://www.google.co.uk/search?
      sourceid=navcli ent&hl=en-GB&ie=UTF-8&r...
      thank you very much for your suggestion, it has been very useful to
      avoid me wasting time on the wrong way, I will try to investigate your
      proposal !

      thank you very much again !

      Bruno

      Comment

      • Bruno Vignola

        #4
        Re: Retrieving OL Calendar items from ASP.NET ...

        On 22 Set, 13:43, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:

        Hello Mark :)

        just wanted u to know that, basing on your suggestion and on this
        useful example: http://blog.downtownsoftwarehouse.com/2006/10/26/
        using-net-and-webdav-to-access-an-exchange-server/, I have been able
        to do in a few hours a small prototype of my app, working fine, using
        WebDAV for accessing the exchange server.

        thank you very much again!

        Bruno

        Comment

        Working...