none
initializing object of outlook 2003 is giving error RRS feed

  • Question

  • i am developing an .net 2010 application using office outlook 2010 object model to work with outlook calander items. It is working fine in .net 2010 with outlook 2010 but it is giving error in outlook 2003 while initializing object because of version mismatch.

    Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();

    Microsoft office 14.0 object  library is there in outlook 2010 which is not supported in outlook 2003. I am not able to run my application where outlook 2003 is installed? can any one suggest me how to resolve this issue and how to develop an application for supporting all outlook versions like 2003,2007,2010 and in all operating systems like windows 7,win XP etc.?


    ammu



    • Edited by ammu sree Monday, April 23, 2012 2:03 PM
    • Moved by John Qiao Tuesday, April 24, 2012 7:12 AM (From:Team Foundation Server - Build Automation)
    Monday, April 23, 2012 1:25 PM

Answers

  • If your solution is developed to use Framework 4 or Framework 4 Client Profile you can look in the References section of the project and review the settings for the Outlook and Office PIA's (also Word if you use that object model at all).
     
    The Embed Interop Types setting in the property sheets for the PIA's should be set to True to embed the PIA's.
     
    With that setup you can run on 2007 or 2003, but make sure that you never call or use any property, method or event not exposed in that runtime version. If you do you will crash Outlook.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "ammu sree" <=?utf-8?B?YW1tdSBzcmVl?=> wrote in message news:77022dad-5975-4b1b-aa56-1624d29baf32...

    Hi Ken Slovak,

    you are saying that we can run our .net 4.0 application using outlook 2003/2007/2010 versions if we install outlook 2010 PIA in our machine. can we run under any outlook version on any operating system with out any bugs if we install 2010 PIA ? can you please tell me how to embed the outlook 2010 PIA in our project?


    ammu



    Ken Slovak MVP - Outlook
    Tuesday, April 24, 2012 3:13 PM
    Moderator

All replies

  • Hi ammu,

    Thanks for posting in the MSDN Forum.

    Outlook 2010's PIA have some different interface or class than Outlook 2003's PIA and Outlook 2003 has a different way to load add-in, it has quite a different process. So it will not make sense to use Outlook 2010's PIA under Outlook 2003's environment.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 24, 2012 7:11 AM
    Moderator
  • In addition to what Tom said, the general rule of thumb is to develop with the oldest version of Outlook that you want to support on your development machine. Depending on what version of Outlook is installed on the user systems that determines what PIA needs to be there, but the code will then work on all versions from 2003 - 2010.
     
    If you use Framework 4 you can make an exception to the rule and embed the Outlook 2010 PIA in the project. Then, as long as you don't use any methods or properties or events not exposed in Outlook 2003 the code should run OK there.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "ammu sree" <=?utf-8?B?YW1tdSBzcmVl?=> wrote in message news:055d186f-a4e6-4750-b15b-4fbbd1d46094...

    i am developing an .net 2010 application using office outlook 2010 object model to work with outlook calander items. It is working fine in .net 2010 with outlook 2010 but it is giving error in outlook 2003 while initializing object because of version mismatch.

    Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();

    Microsoft office 14.0 object  library is there in outlook 2010 which is not supported in outlook 2003. I am not able to run my application where outlook 2003 is installed? can any one suggest me how to resolve this issue and how to develop an application for supporting all outlook versions like 2003,2007,2010 and in all operating systems like windows 7,win XP etc.?


    ammu




    Ken Slovak MVP - Outlook
    Tuesday, April 24, 2012 1:08 PM
    Moderator
  • Hi Ken Slovak,

    you are saying that we can run our .net 4.0 application using outlook 2003/2007/2010 versions if we install outlook 2010 PIA in our machine. can we run under any outlook version on any operating system with out any bugs if we install 2010 PIA ? can you please tell me how to embed the outlook 2010 PIA in our project?


    ammu


    • Edited by ammu sree Tuesday, April 24, 2012 2:15 PM
    Tuesday, April 24, 2012 2:14 PM
  • If your solution is developed to use Framework 4 or Framework 4 Client Profile you can look in the References section of the project and review the settings for the Outlook and Office PIA's (also Word if you use that object model at all).
     
    The Embed Interop Types setting in the property sheets for the PIA's should be set to True to embed the PIA's.
     
    With that setup you can run on 2007 or 2003, but make sure that you never call or use any property, method or event not exposed in that runtime version. If you do you will crash Outlook.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "ammu sree" <=?utf-8?B?YW1tdSBzcmVl?=> wrote in message news:77022dad-5975-4b1b-aa56-1624d29baf32...

    Hi Ken Slovak,

    you are saying that we can run our .net 4.0 application using outlook 2003/2007/2010 versions if we install outlook 2010 PIA in our machine. can we run under any outlook version on any operating system with out any bugs if we install 2010 PIA ? can you please tell me how to embed the outlook 2010 PIA in our project?


    ammu



    Ken Slovak MVP - Outlook
    Tuesday, April 24, 2012 3:13 PM
    Moderator