Aracılığıyla paylaş


2007 Microsoft Office Add-in Project Templates

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Application-level projects

Microsoft Office version

  • Excel 2007

  • InfoPath 2007

  • Outlook 2007

  • PowerPoint 2007

  • Project 2007

  • Visio 2007

  • Word 2007

For more information, see Features Available by Application and Project Type.

Add-in project templates for the 2007 Microsoft Office system automatically add the necessary project references, files, and basic code to use as a starting point for application-level add-ins for the applications listed above.

For more information about application-level add-ins, see Getting Started Programming Application-Level Add-Ins.

Note

By default, some of the files and references in the following list are hidden. To see them, click Show All Files on the Solution Explorer toolbar. Additionally, there are some files and references not in the following list that are common to many Visual Studio project templates.

Files

Visual Studio Tools for Office generates one visible code file in add-in projects:

  • ThisAddIn (.vb file for Visual Basic or .cs file for Visual C#) - This file provides a partial definition of the ThisAddIn class. The rest of this class is defined in a hidden code file.

    The ThisAddIn class is the entry point for code that you write in the add-in. For more information, see AddIn Host Item.

Visual Studio Tools for Office also generates the following additional file when you build an add-in project for the 2007 Microsoft Office system:

Hidden Files

Visual Studio Tools for Office generates several hidden code files. Do not modify these files manually; they are regenerated when changes are made to the project and they do not retain manual modifications.

Visual Studio Tools for Office generates the following hidden code files:

  • ThisAddIn.Designer.xml - A declarative representation of the programmable objects in the add-in project.

  • ThisAddIn.Designer (.vb file for Visual Basic or .cs file for Visual C#) - A code file that provides a partial definition of the ThisAddIn class. This includes constructors, various initialization methods, and other code that is automatically generated at design time. The rest of this class is defined in the ThisAddIn code file.

Template Code

The following event handlers are included in the ThisAddIn code file. For more information, see Visual Studio Tools for Office Project Events.

ThisAddIn_Startup

This method handles the Startup event, which is raised after the application is running and all the initialization code in the add-in assembly has run. Use this method to run code that initializes your add-in.

ThisAddIn_Shutdown

This method handles the Shutdown event, which is raised when the application domain that your code is loaded in is about to be unloaded. Use this method to clean up resources used by your add-in.

References

Visual Studio Tools for Office automatically creates a set of assembly references in add-in projects. These references include the following assemblies:

  • Assemblies in the Visual Studio Tools for Office runtime. For more information about these assemblies, see Visual Studio Tools for Office Runtime Overview.

  • Primary interop assemblies for shared Microsoft Office components and the Microsoft Office application that your project works with. For more information, see Office Primary Interop Assemblies.

  • .NET Framework assemblies that are used when you develop Visual Studio Tools for Office solutions.

See Also

Tasks

How to: Create Visual Studio Tools for Office Projects

Concepts

Getting Started Programming Application-Level Add-Ins

Assemblies in Office Solutions Overview

Other Resources

Office Project Templates

Managing Solutions, Projects, and Files