Limitations of Global Templates and Add-ins
Document-level customizations for Microsoft Office Word and Microsoft Office Excel might not work correctly as Word global templates or Excel add-ins. If you want to create a solution that runs for every document or workbook that is opened in the application, you should consider creating an application-level add-in.
If a Word template has managed code extensions, the project assembly is not called if the template is attached as a global template or loaded from the Startup directory of Word. In addition, the document does not recognize the format of a template that is part of a Visual Studio Tools for Office solution.
Excel Add-ins (.xla Files)
There is no Visual Studio Tools for Office project for creating an Excel add-in (.xla) file. It is possible to save a workbook as an add-in, but it is not a supported operation and is not recommended. If you save a workbook that has managed code extensions as a Microsoft Office Excel Add-In (*.xla) file, you can select it in the Add-Ins dialog box to apply to another workbook. In some cases your code will run in the target workbook after the add-in is applied, but such use of the Visual Studio Tools for Office solution is not supported.
Document-level customizations are specific to a particular document; the code does not run for every document that is opened in the application. If you want to create code that runs for every document or workbook, you can create an application-level add-in by using Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System (VSTO 2005 SE). For more information, seeand .