locked
How to create a outlook add ins that is compatible with outlook 2003/2007/2010 RRS feed

  • Question

  • I created a VSTO outlook project in visual studio 2008. It runs smoothly in outlook 2007. But when I run same code into the machine where office 2010 installed it doesn't run. 

    Is there any way that I can create a outlook add ins that is compatible with outlook 2003/2007/2010.


    A person who never made a mistake never tried anything new.
    Wednesday, August 4, 2010 4:05 AM

Answers

  • No matter whether you use a shared addin or a VSTO addin you still must develop it on a machine with Office 2003 installed, and you must reference Outlook 2003 in your project references. That means you can only use methods/properties/events exposed in 2003, unless you discover at runtime you are on a later version and you use reflection (late binding) to access a property or method.
     
    I find it easier to work with a deployment like that in a shared addin. It can be done in a VSTO addin using methods that Andrew Whitechapel discussed in his blog.
     
    If you developed on a machine with Outlook 2007 on it your code will only run in 2007 or 2010.

    --
    Ken Slovak
    [MVP - Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007.
    Reminder Manager, Extended Reminders, Attachment Options.
    http://www.slovaktech.com/products.htm
     
     
    "cissharp" <=?utf-8?B?Y2lzc2hhcnA=?=> wrote in message news:bdec0ac5-4226-4d52-a6a5-503fb9828691...

    Thanks Ken,

    You mean instead of using VSTO, if I use Shared Add Ins I can create all outlook compatible solution? Please clearify me on this. I am stucked because the solution I created for Outlook 2007 works for outlook 2010 but not for outlook 2003. If Shared Add Ins project can help me on this I will go on this. Please suggest.

    Thank you,


    A person who never made a mistake never tried anything new.

    Ken Slovak MVP - Outlook
    • Marked as answer by Bessie Zhao Wednesday, August 11, 2010 7:28 AM
    Wednesday, August 4, 2010 1:39 PM

All replies

  • An addin designed to run on those 3 versions should be developed on a machine that has Office 2003 installed. You always use the oldest version you want to support as your development environment.
     
    VSTO addins are usually designed to support only 2 versions of Outlook. So in this case you'd need to use an older version of VSTO and probably of VS, and you'd need to handle the ribbon completely differently using a model similar to that laid out by Andrew Whitechapel (a former member of the VSTO team) in a series of blog articles. The idea is presented at http://xldennis.wordpress.com/2006/12/22/using-iribbonextensibilitys-type-library-with-com-add-ins/ and in other articles in his blog.
     
    For support of those versions I'd probably use a shared addin myself, and not a VSTO addin.
     
    An Outlook 2003 targeted addin should run in Outlook 2010, as long as it's the 32-bit version of Office. For the 64-bit version you need to compile as 64-bit or Any, and all supporting DLL's and anything else you use must also be 64-bit, and you need to run a 64-bit installer and shimming.

    --
    Ken Slovak
    [MVP - Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007.
    Reminder Manager, Extended Reminders, Attachment Options.
    http://www.slovaktech.com/products.htm
     
     
    "cissharp" <=?utf-8?B?Y2lzc2hhcnA=?=> wrote in message news:72ef1fee-eca3-4741-b199-8208b99a5be8...

    I created a VSTO outlook project in visual studio 2008. It runs smoothly in outlook 2007. But when I run same code into the machine where office 2010 installed it doesn't run. 

    Is there any way that I can create a outlook add ins that is compatible with outlook 2003/2007/2010.


    A person who never made a mistake never tried anything new.

    Ken Slovak MVP - Outlook
    Wednesday, August 4, 2010 1:18 PM
  • Thanks Ken,

    You mean instead of using VSTO, if I use Shared Add Ins I can create all outlook compatible solution? Please clearify me on this. I am stucked because the solution I created for Outlook 2007 works for outlook 2010 but not for outlook 2003. If Shared Add Ins project can help me on this I will go on this. Please suggest.

    Thank you,


    A person who never made a mistake never tried anything new.
    Wednesday, August 4, 2010 1:27 PM
  • No matter whether you use a shared addin or a VSTO addin you still must develop it on a machine with Office 2003 installed, and you must reference Outlook 2003 in your project references. That means you can only use methods/properties/events exposed in 2003, unless you discover at runtime you are on a later version and you use reflection (late binding) to access a property or method.
     
    I find it easier to work with a deployment like that in a shared addin. It can be done in a VSTO addin using methods that Andrew Whitechapel discussed in his blog.
     
    If you developed on a machine with Outlook 2007 on it your code will only run in 2007 or 2010.

    --
    Ken Slovak
    [MVP - Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007.
    Reminder Manager, Extended Reminders, Attachment Options.
    http://www.slovaktech.com/products.htm
     
     
    "cissharp" <=?utf-8?B?Y2lzc2hhcnA=?=> wrote in message news:bdec0ac5-4226-4d52-a6a5-503fb9828691...

    Thanks Ken,

    You mean instead of using VSTO, if I use Shared Add Ins I can create all outlook compatible solution? Please clearify me on this. I am stucked because the solution I created for Outlook 2007 works for outlook 2010 but not for outlook 2003. If Shared Add Ins project can help me on this I will go on this. Please suggest.

    Thank you,


    A person who never made a mistake never tried anything new.

    Ken Slovak MVP - Outlook
    • Marked as answer by Bessie Zhao Wednesday, August 11, 2010 7:28 AM
    Wednesday, August 4, 2010 1:39 PM