none
Word / Excel / Powerpoint addin and / or document, 2007 and / or 2010: How to choose RRS feed

  • Question

  • Dear all,

    I am currently planning the development of a new add-in for Office applications, and my customer requirements are as follow:

    1) The add-in must work for Word, Powerpoint, Excel.

    2) Some features are application-wide (such as connect / disconnect) and some others are document-specific (such as display some document contextual data).

    3) The add-in must use the ribbon in some use case, and the task pane in some other use cases.

    4) Office 2007 and Office 2010 are supported.

    So my question is: how many add-in projects will I need? 1, 2, 3, 4, 6, 12 ...?

    Sorry if this is a FAQ, but I wasn't able to find a clear answer to that, so I thought I would better to ask.

    Let's review the situation and break down a bit the question:

    a) Is it possible to write an add-in that target Word, Excel AND Powerpoint, and is able to access their ribbon and their task pane? (yes may mean only one add-in project, no means at least 3)

    b) Is it better to have an application-level add-in that refreshes the content of the task-pane when the active document changes, or to have a document-level add-in for document-contextual data? (document level means the answer is the double of what was found in a), right?)

    c) To support both Office 2007 and 2010, what is the right strategy: i) write an add-in for Office 2007 that will work fine in Office 2010, ii) write an add-in for Office 2010 and only use Office 2007 object model so it will be Office 2007 compatible, or iii) write both add-ins for Office 2007 and 2010? (obviously iii) means the answer is the double of what was found in b), correct?)

    Any real world or precise suggestions or feedback will be greatly appreciated.

    Thanks in advance,

    Nouvel R

    Thursday, March 8, 2012 2:26 PM

Answers

  • a) You can create a Shared Add-in, but this VS project type differs from VSTO in that there are no designers specific for the Ribbon or Office Apps.  You'd have to do quite a bit of code branching based on the evaluation of the active Application object to call the code specific to the Office app that's hosting the add-in during runtime.

    b) If your add-in is content agnostic, then an Application level add-in is more appropriate (yes, I'm being vague because I have way more experience with Outlook add-ins than document ones!)

    c) In VS 2010 you can embed the PIAs for your Office 2010 references so that the correct PIA version will load dynamically at runtime for Office 2007 add-ins. However, if you use 2010 specific Object Model entities than you'll still need to branch your code based on the runtime version.  I've done something similar with version-specific secondary assemblies without embedded PIAs to handle UI (esp. Ribbon) and OM changes between the versions, but this is geared more towards handling Office 2003 and earlier as well.  See here for a great example:

    Version-Specific UI in Add-ins - Andrew Whitechapel - Site Home - MSDN Blogs:
    http://blogs.msdn.com/b/andreww/archive/2008/09/02/version-specific-ui-in-add-ins.aspx

    Another helpful reference:

    Creating an Add-in for Office 2007 and Office 2010 that "Lights Up" on Office 2010 (McLean Schofield) - Office Development with Visual Studio - Site Home - MSDN Blogs:
    http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx

    To cover my butt for anything I've got wrong, I've been spoiled by using the Add-in Express framework to write add-ins vs. VSTO because it's SO much easier to support multiple Office apps and versions.


    Eric Legault
    MVP (Outlook)
    About me...

    Thursday, March 8, 2012 3:59 PM
    Moderator

All replies

  • a) You can create a Shared Add-in, but this VS project type differs from VSTO in that there are no designers specific for the Ribbon or Office Apps.  You'd have to do quite a bit of code branching based on the evaluation of the active Application object to call the code specific to the Office app that's hosting the add-in during runtime.

    b) If your add-in is content agnostic, then an Application level add-in is more appropriate (yes, I'm being vague because I have way more experience with Outlook add-ins than document ones!)

    c) In VS 2010 you can embed the PIAs for your Office 2010 references so that the correct PIA version will load dynamically at runtime for Office 2007 add-ins. However, if you use 2010 specific Object Model entities than you'll still need to branch your code based on the runtime version.  I've done something similar with version-specific secondary assemblies without embedded PIAs to handle UI (esp. Ribbon) and OM changes between the versions, but this is geared more towards handling Office 2003 and earlier as well.  See here for a great example:

    Version-Specific UI in Add-ins - Andrew Whitechapel - Site Home - MSDN Blogs:
    http://blogs.msdn.com/b/andreww/archive/2008/09/02/version-specific-ui-in-add-ins.aspx

    Another helpful reference:

    Creating an Add-in for Office 2007 and Office 2010 that "Lights Up" on Office 2010 (McLean Schofield) - Office Development with Visual Studio - Site Home - MSDN Blogs:
    http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx

    To cover my butt for anything I've got wrong, I've been spoiled by using the Add-in Express framework to write add-ins vs. VSTO because it's SO much easier to support multiple Office apps and versions.


    Eric Legault
    MVP (Outlook)
    About me...

    Thursday, March 8, 2012 3:59 PM
    Moderator
  • Hi Eric,

    Thank you for your answer. I've just reviewed the Add-in express solution and, you are right, it's a much easier solution. I'll go this way.

    Thanks again.

    Nouvel R

    Monday, March 12, 2012 10:19 AM
  • Hi Eric,
    What are the steps to convert an Word 2010 add in to word 2007 add in?.
    Kind Regards,
    Simone

    Thursday, October 11, 2012 11:05 AM
  • Simone, if you create a Word 2007 add-in in Visual Studio 2010 it should also work with Word 2010.  However, you can also now create a Word 2010 add-in that will work in Word 2007 if you embed the PIA's.  See here for more info:

    Creating an Add-in for Office 2007 and Office 2010 that "Lights Up" on Office 2010 (McLean Schofield) - Office Development with Visual Studio - Site Home - MSDN Blogs:
    http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx


    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Thursday, October 11, 2012 3:09 PM
    Moderator