|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|
VBA Object Model Changes
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
The Microsoft Office Project 2007 desktop client applications—Project Standard 2007 and Project Professional 2007—include an upgrade of the Microsoft Visual Basic for Applications (VBA) object model. The Project 2007 object model includes bug fixes from earlier versions and support for new features in the Project 2007 platform.
The VBA object model in Project Standard 2007 includes support for the following new features:
Simplified custom fields and outline codes
Multiple undo and redo actions
Effective calendar dates and calendar exceptions
Advanced desktop reporting using Visual Reports
Task drivers and recalculation change highlighting to help clarify scheduling processes
Costs and budget
The Project Professional 2007 object model includes the Project Standard features and adds support for the following:
Project Deliverables for improved collaboration and cross-project links
Conversion or mapping of local custom fields, calendars, and resources to enterprise
Validation of enterprise formulas
Queuing Service events
Importing of a Windows SharePoint Services 3.0 project
Saving of a local copy of a Project Server project for sharing
In total, the Project 2007 object model includes 1424 new, changed, or hidden items, as follows:
New classes: 13
Class members added, changed, or hidden: 1067
New enumerations: 24
New enumeration members: 322
Enterprise custom field properties All of the enterprise custom field and enterprise outline code properties are hidden because Project Server 2007 is not limited to built-in enterprise custom fields. For more information about enterprise custom fields and outline codes, see Local and Enterprise Custom Fields.
Creating a custom toolbar in the enterprise global To deploy a macro to a group of Project Professional users, you can copy the macro to the enterprise global template. You can then create a custom toolbar, copy that to the enterprise global, and reference any required files in the macro by using a SharePoint site. For more information and an example, see Changes for Custom Project Guides.
Using VBA Help The Project 2007 SDK does not include the full VBA Help reference. To access VBA Help, open the Visual Basic Editor in Project, and then click the Help menu or press F1. The VBA Help file for Project 2007 is the Microsoft Help 2.0 format WINPROJDEV.HXS file in the [Program Files]\Microsoft Office\Office12\[LCID] directory, where LCID is the locale ID. For example, the English VBA Help for Project is [Program Files]\Microsoft Office\Office12\1033\WINPROJDEV.HXS. To access updated VBA Help, click the Connection Status menu in the lower right corner of the Project Help window, and then select Show content from Office Online.
The developer technologies and tools for automating Project 2007 include the Visual Basic Editor (VBE) for recording and developing VBA macros and integrating with Microsoft Office Word, Microsoft Office Excel, and the hundreds of other applications that expose a VBA object model. The primary interop assembly for Project 2007 helps developers take advantage of the power and features of the Microsoft .NET Framework and integrate with the Project object model from managed assemblies.
Methods that have changed parameters have Ex (for Extended) appended to the method name. When you record a macro in Project 2007, the macro uses the changed methods. For example, when you are recording a macro and close the project file, the macro records FileCloseEx. The original methods are hidden in the Object Browser in the VBE. To see hidden members, right-click anywhere in the Object Browser window and then click Show Hidden Members. Hidden members are not documented in the Project 2007 VBA Help file or in the Project 2007 SDK.
VBA remains useful for recording macros and developing relatively simple Automation solutions. The .NET Framework 3.0, Microsoft Visual Studio 2005 Tools for the Microsoft Office System - Second Edition (VSTO 2005 SE), and the Project 2007 primary interop assembly provide advantages for developing more complex, secure, and scalable solutions that automate the Project 2007 desktop clients. The next release of VSTO with Visual Studio 2008 includes templates for developing application-level add-ins for Project 2003 and Project 2007 (either the Project Standard or Project Professional versions). VSTO 2008 greatly simplifies developing, testing, and deploying advanced integration solutions that use the Project desktop client.
Shows how to use different Project_Open event handlers in the global template, enterprise global template, and local projects.