[Blog Map] This blog is inactive. New blog: EricWhite.com/blog
The most important technology for building Office applications is that of managed customizations (including application-level managed add-ins, and document-level customizations). Understanding the architecture and capabilities of managed customizations enables you to place the various developer technologies in context. It is important to know which building blocks are integral to managed customizations, which building blocks provide the foundation for managed customizations, and which building blocks commonly are used in conjunction with managed customizations to provide users with the necessary functionality.
This post is one in a series on Microsoft Office 2010 application development. These posts will be published in the future as part of an MSDN article. As usual, after the MSDN article is published, I’ll place pointers in the blog posts to the article on MSDN.
As I mentioned in Overview of Office 2010 Application Development, managed customizations consists of .NET classes that wrap the underlying COM libraries. Because add-ins wrap COM libraries, there are some differences between these class hierarchies when compared to other .NET class libraries.
Other than these differences, while the class hierarchies for each of the various applications are extensive, they are straightforward and easy to use. For example, in the Word object model, you commonly work with the Application, Document, Paragraph, and Range classes. See the Word Object Model Overview for more information. In the Excel object model, you commonly work with the Application, Workbook, Worksheet, and Range classes. See the Excel Object Model Overview for more information.
You can build managed add-ins for Word, Excel, Outlook, PowerPoint, Project, Visio, and InfoPath. For the other applications, you need to use COM or other developer technologies to extend them.
One key difference between writing COM interfaces and writing a managed add-in is that when building applications using the COM interfaces, you could place ActiveX controls in the document or spreadsheet. When writing a managed add-in, you use host items and host controls, which extend the underlying COM interface with some amount of additional functionality, a few more events, and the ability to use .NET Windows Forms controls on the surface of the document. See Host Items and Host Controls Overview for more information.
When you create a new Office 2010 project in Visual Studio, you must pick from one of a variety of project templates. Following are the project templates for C#. VB.NET, of course, has the same set of templates.
The following table details the varieties of add-ins:
Project Template Name
Excel 2010 Add-in
Excel 2010 Template
Document-level customization that creates and customizes an Excel template
Excel 2010 Workbook
Document-level customization that creates and customizes an Excel workbook
InfoPath 2010 Add-in
Outlook 2010 Add-in
PowerPoint 2010 Add-in
Project 2010 Add-in
Visio 2010 Add-in
Word 2010 Add-in
Word 2010 Document
Document-level customization that creates and customizes a Word document
Word 2010 Template
Document-level customization that creates and customizes a Word template
The difference between a document-level add-in that creates a template and a document-level add-in that creates a document or workbook is that when the user uses the add-in to create a template (either a document or spreadsheet), the user opens a template to create a local copy as a new document. They cannot modify the original template unless they are given special permissions. See Office Project Templates Overview and Document vs. Template Solutions for more information.
SDK: Features Available by Office Application and Project Type
Developer Center: VSTO Developer Center
MSDN: Office Solutions Development Overview