VSTO 2005 Second Edition - hot off the press

VSTO 2005 Second Edition Beta (aka VSTO2005SE) - this is a new free product that complements VSTO 2005. See this announcement from KD Hallman if you want to know general details about the product and the roadmap.

I am here to discuss technical details of what it is. First of all - there is a new design time experience for building managed Add-Ins for Office 2003 applications (Excel, Word, Outlook, Visio and PowerPoint - this is for those who use Office 2003 and VS 2005) as well as support for building managed Add-Ins for Office 2007 applications (InfoPath jumped on this band wagon as well).

There is not much difference between Office 2003 and Office 2007 projects. Here, I can count those differences below:

  • Office 2003 projects by default reference Office 2003 PIAs while Office 2007 by default references Office 2007 PIAs
  • Office 2007 projects (except for Visio) do have CustomTaskPanes collection that allows you to easily put WinForm controls onto app level task panes.
  • Office 2007 projects (except for Visio and InfoPath) do support easier creation of Ribbon.xml files and hooking those up. So, getting a vanilla Ribbon takes about 30 secs.

The VSTO2005SE projects are very similar to what the Outlook Add-In project looked in VSTO 2005. The very first difference is that the name of the entry point class has changed - it is not longer ThisApplication, but is rather ThisAdd. So, instead of writing this.Inspectors to get to the Outlook's Inspectors collection you will write this.Application.Inspectors.

If you want to take advantage of new Office 2007 functionality that is exposed to add-ins you will need to implement a ComVisible public class deriving from any arbitrary interface e.g. IRibbonExtensibility, FormRegionStartup(one does not have to implement ICustomTaskPaneConsumer - VSTO runtime takes care when you call ThisAddin.CustomTaskPanes.Add(new UserControl(), "My task pane") . Next you will need to return this class from ThisAddIn's RequestService override. Here is a little example:

    public partial class ThisAddIn

    {

        private Ribbon1 ribbon;

        protected override object RequestService(Guid serviceGuid)

        {

            if (serviceGuid == typeof(Office.IRibbonExtensibility).GUID)

            {

                if (ribbon == null)

                    ribbon = new Ribbon1();

                return ribbon;

            }

            return base.RequestService(serviceGuid);

        }

    }

    [ComVisible(true)]

    public class Ribbon1 : Office.IRibbonExtensibility

    {

Unless I missed something that pretty much concludes the general design time discussion. In my next posts I will probably talk more about how to add a Ribbon to VSTO add-ins.

We will also be shipping a new VSTO runtime redist. Unlike, VSTO 2005 Design Time - the new redist is not a new product, but is rather an upgrade for the original runtime redist. The reason for the runtime upgrade is that it incorporates this addition CustomTaskPanes functionality and support for arbitrary services that VSTO customizations can now expose. Also, we fixed a number of breaking changes in Excel's ListObject functionality that affected the behavior of ListObject's data-binding on Office12.

One final note - you MOST probably will have trouble using this software if you ever installed VSTO v3 CTP - unfortunately, due to the poor setup support in VSTO v3 CTP, uninstalling it won't solve the problem. You may try to uninstall any the CTP, VSTO 2005 and all the traces of Visual Studio from the machine - then it MIGHT solve the problems. However, the most reliable solution is just re-installing the OS. That is not fun and I am profusely apologizing that you might have to do that. We did much better job with this release to ensure we do have a clear servicing path for this product.