VSTA: What is an Add-in?

This is an excellent question posed by TQ, one of our architects, on his blog. The definition of an add-in is:

An “Add-in” is any component that is dynamically discovered and loaded by its host. It usually is compiled separately from the host and the host and Add-in version independently of each other. The host and add-in must agree upon a common contract or contracts through which they communicate.

So think about all of the types of add-ins in Office alone: VBA macros, Com add-ins, Smart Tags, Real Time Data, VSTO assemblies and others. As TQ talked about in his blog, these all require some kind of contract that enables them to communicate with the host. For example Com add-ins requires the IDTExensibility2 interface. Smart Tags must implement ISmartTagRecognizer and ISmartTagAction. The point is that all of these different types of add-ins are not only add-ins in the common sense but enable customization at all levels of an application. For example your application could support application level add-ins, document level add-ins or any other level. So free your mind to think about at what level is the appropriate level and what context should the add-in focus on. Creating the add-in at the correct level and context makes it easy for the add-in writer because they do not have to walk the object model to get to the correct context. Similar to the experience between writing a generic Com add-in for Excel or using VSTO to create a solution. The VSTO solution is easier to write because it focuses on the correct level and context.

-----
This posting is provided "AS IS" with no warranties, and confers no rights.