|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.
Microsoft Office version
For more information, see Features Available by Application and Project Type.
Visual Studio Tools for Office provides project templates you can use to create application-level add-ins for Microsoft Office Project. You can use add-ins to automate Project, extend Project features, or customize the Project user interface (UI).
For more information about application-level add-ins, see Getting Started Programming Application-Level Add-Ins and Architecture of Application-Level Add-Ins.
If you are new to programming with Microsoft Office, see Getting Started (Visual Studio Tools for Office).
The Project object model exposes many types that you can use to automate Project. These types enable you to write code to accomplish common tasks such as programmatically creating and modifying tasks in a project.
To access the Project object model from a Visual Studio Tools for Office add-in, use the Application field of the ThisAddIn class in your project. The Application field returns a Microsoft.Office.Interop.MsProject.Application object that represents the current instance of Project. For more information, see Programming Application-Level Add-Ins.
When you call into the Project object model, you use types that are provided in the primary interop assembly for Project. The primary interop assembly acts as a bridge between the managed code in the Visual Studio Tools for Office add-in and the COM object model in Project. All types in the Project primary interop assembly are defined in the Microsoft.Office.Interop.MSProject namespace. For more information about primary interop assemblies, see Office Solutions Development Overview and Office Primary Interop Assemblies.
For information about the classes you can use in the Project object model, see the following sets of documentation:
These links provide information about the Project object model as it is exposed to Visual Basic for Applications (VBA) code. These descriptions of objects and members also apply to the corresponding classes in the primary interop assemblies. For example, the Calendar object in the Project VBA documentation corresponds to the Microsoft.Office.Interop.MSProject.Calendar class in the primary interop assembly.
Additional Types in Primary Interop Assemblies
The primary interop assemblies contain many types that are not available to VBA. These additional types help translate objects in the COM-based object model of Project to managed code, are not intended to be used directly in your code.
For more information, see Overview of Classes and Interfaces in the Office Primary Interop Assemblies.
You can customize the Project UI in the following ways.
For more information
Add custom toolbars and toolbar items.
Add menus and menu items.
For more information about customizing the UI of Project and other Microsoft Office applications, see Office UI Customization.