共用方式為


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.

Comments

  • Anonymous
    September 14, 2006
    Quick question ... so if I take advantage of VSTO2005SE to create a managed add-in for Word 2003, can this add-in easily work with the actions pane (like a VSTO 2003 document level customization can)?

    Or are VSTO2005SE managed add-ins for Office 2003 essentially "replacements" for COM add-ins, except the loader process is now different (and thus shimming is not required)?

    Thanks!

  • Anonymous
    September 14, 2006
    Most of the gadgets that are available to doc-level customization were out of scope for VSTO2005SE - one of those is ActionsPane. Actually, since I know a lot of internals of VSTO I would probably be able to hook up ActionsPane from app-level add-in - but this implementation would not be for weak hearted - hence I will keep it to myself for a while in the incubation stage.
    So, yes, shimming is not required for those add-ins and essentially those are the better story for managed add-ins then shared add-ins.
    Among the features that are shared between doc-level and app-level stuff is deployment and security models and appdomain isolation We have also added Excel's LCIDProxy for Excel add-ins to allow managed code to run easily on non-ENU systems.
    In the future we are looking into bringing doc-level features over - but we do not know what the delivery vehicle for this would be.

  • Anonymous
    September 14, 2006
    VSTO 2005 Second Edition (SE) Beta (codenamed "Cypress") has been released on the web ...

  • Anonymous
    September 15, 2006
    Misha --

    Thanks for the reply.

    So if I'm reading your reply correctly, if I want to interact with the actions pane (i.e., add WinForms controls that interact w/ the document) in Word 2003, then doc level customizations (stuff already provided in VSTO 2.0) are still that way to go?

    "....hence I will keep it to myself for a while in the incubation stage"

    Does the above mean there's a chance that global 2003 add-ins may have support for interaction with the actions pane by the time VSTO 3 is released? If so, would that behavior be similar to custom task pane interaction in VSTO 3 + Word 2007.

    You probably see where I'm going here ... we would love to see managed global add-in support that allows interaction with the actions pane/custom task panes for BOTH Word 2007 and 2003.

  • Anonymous
    September 15, 2006
    Yep, I can hear you. I can not promize anything but I can tell you that we are thinking very hard about this.

  • Anonymous
    September 15, 2006
    Thanks for the info Misha -- this is very helpful.

    Global add-in support WITH actions pane/custom task pane interaction for Office 2003 would be huge for us. We are looking to develop a managed app level Word add-in (that makes heavy use of the actions pane/custom task pane) that supports both 2003 and 2007.

    Conceptually, we want a single base DLL (MyAddin.dll) that will work with both 2003 and 2007 and contain most of the code (including the user control that will be added to the actions pane/custom task pane). Then, we will create pluggable version specific DLLs (i.e., MyAddin.Word2003.dll and MyAddin.Word2007.dll) that will contain UI and object model specific code for each version of Word. For example, the Word2003 DLL will contain CommandBar specific code and will load the user control in the actions pane ... the Word2007 DLL contain RibbonX specific code and will load the user control into a custom task pane. I think you get the idea.

    This would be huge for us, and enable us to support both 2003 and 2007 without writing two similar but separate codebases.

  • Anonymous
    September 30, 2006
    Hi, Misha, is it correct, that there are no project templates for Word docs and Excel workbooks/templates like in the v3 CTP? I installed the SE and have only templates for Add Ins for 2003/2007. Thank you for an answer.

  • Anonymous
    October 01, 2006
    True, design time in SE only adresses the add-ins.

  • Anonymous
    December 05, 2006
    The comment has been removed

  • Anonymous
    January 05, 2007
    while its not about VSTO 2005 SE..but i would love to know your thoughts on this ..  http://blogs.msdn.com/pranavwagh/archive/2007/01/06/here-is-a-question.aspx

  • Anonymous
    February 05, 2007
    Hi Misha, one more voice for the actions pane access from within managed add-in. Currently our add-in uses a custom dialog floating on top of the document. We planned to put it into the actions pane once we drop Office XP support. But it looks there is still a long wait for us, as our customers do not upgrade to Office 2007 in foreseeable future and there is no easy way to exploit the actions pane in Office 2003. Any good news for us? Thanks a lot, Michael.

  • Anonymous
    February 05, 2007
    Hi Michael, I am really sorry to disappoint you. Unfortunately, in this release we did not come around to supporting ActionsPane for the add-ins.

  • Anonymous
    February 06, 2007
    Thanks, Misha, for the quick reply. We'll try to be more creative then.

  • Anonymous
    February 09, 2007
    Misha, Just to make sure I under you correct: VSTO 2005 SE does NOT support ActionsPane for Excel 2003? while VSTO 2005 does, on a document- level. If that's the case, given our project heavily uses action pane and needs to support Excel 2003, I would stick with the VSTO 2005 ( 1st edition ). Pleaes advice.

  • Anonymous
    February 09, 2007
    VSTO2005SE runtime is a superset of VSTO2005 runtime. So, ActionsPane for doc-level customization on Excel 2003 and Word 2003 is supported.

  • Anonymous
    March 08, 2007
    The original deployment paper targeted deployment aspects of customizations built using VSTO 2005 release

  • Anonymous
    May 06, 2007
    Guys, the financial industry is not going to support Office 2007 any time soon, we're just now converting to Excel 2003... When are you planning to support creation of host items or at least working with actions pane in Excel 2003? Without this, the add-in has little use to us - we need to generate rich Excel spreadsheets from an application level add-in. Took me a while to realize this would not be possible via VSTO 2005 SE.

  • Anonymous
    October 28, 2007
    Misha, I am uploading my VSTO SE application to test for Office 2007. Can you tell me if through VSTO SE, i can support new default extensions of .xlsx,xlsm in my project. I am able to support .xls support for Office 2007. Basically what i am looking for is, if can i open through VSTO SE in office 2007 dedault extension of .xlsx and save in this format and open in this format

  • Anonymous
    October 29, 2007
    Kim, Sorry, I could not understand what you are trying to do exactly so if you could clarify your scenario that would help. I will try to write something but I am not sure whether it directly applies to your scenario. If you have a customized .XLS file - you can save it as an .XLSX file without loosing functionality i.e. opening such file in Excel will cause the customization to run as expected. VSTO 2005 SE does not have additional support for directly designing in Office 2007 (as in VS2005 you could host .xls files directly inside Visual Studio), but again you can design using Office 2003 and then save files in new format.

  • Anonymous
    March 12, 2009
    i dont know why microsoft missed document level customisation functionality with VSTO 2005SE,Which was available with VSTO2005.does it not looks like old was gold?and even 2005 is no more available.what to do?when microsot is going to release new one?now how to go with document level customisation?

  • Anonymous
    January 10, 2010
    Thanks VS 2010 that supports document level customisation.