VBA Object Model Changes
Applies to: Office 2010 | Project 2010 | Project Server 2010 | SharePoint Server 2010
The Microsoft Project 2010 desktop client applications—Project Standard 2010 and Project Professional 2010—include an upgrade of the Microsoft Visual Basic for Applications (VBA) object model. The Project 2010 object model includes bug fixes from earlier versions, support of both 32-bit and 64-bit versions of Project 2010, and support for new features in the Project 2010 platform.
For a list of new objects, members, and enumerations, see Tables of VBA Object Model Changes or VBA Help in Project 2010.
Tip
When you digitally sign a macro project, you can open the project without seeing the Microsoft Project Security Notice dialog box. The Digitally sign your macro project article applies to all Microsoft Office 2010 products that use VBA, including Project 2010.
VBA Support for New Features
Project Standard: The VBA object model in Project Standard 2010 includes support for the following new features:
Managing the Timeline view
Manually scheduled tasks
Task warnings and suggestions
Improved management of views, filters, and highlighting
New group objects that maintain group hierarchy
Comparing project versions
Managing overallocated assignments
Panning and zooming a view
24-bit color, where color can be expressed as hexadecimal RGB values (red is the least significant byte)
The older members that use only 16 colors have equivalent new members for 24-bit color. For example, the old FontEx method uses the 16-color PjColor enumeration. The new Font32Ex method supports 24-bit colors such as &HA0FF00 (a blue-green).
Project Professional: The Project Professional 2010 object model includes the Project Standard features and adds support for the following:
The Team Planner view
Sharing local projects on Microsoft SharePoint Server 2010 tasks lists
Managing data exchange between SharePoint tasks lists and Project custom fields
Synchronizing task deliverables and dependencies
Opening a project from a SharePoint document library
Not counting the hidden members, the Project 2010 object model includes 508 new or changed items, as follows:
New classes: 7
Class members added or changed: 244
Properties: 111
Methods: 133New enumerations: 17
New enumeration members: 240
For a list of all changes in the object model since Microsoft Project 2000, see VBA Help in Project Standard 2010 or Project Professional 2010. To see hidden members, right-click within the Object Browser in the Visual Basic Editor (VBE), and then click Show Hidden Members in the option menu. Hidden members can be used by existing VBA code, but should not be used for new development. In cases where the feature that they represent no longer exists or where the feature does not work the same in Project 2010, hidden members do nothing. Hidden members are not documented in the Project 2010 VBA Help file or in the Project 2010 SDK.
Using VBA Help
The Project 2010 SDK in the MSDN Library online does not include the full VBA Help reference. The Project 2010 SDK download includes an update of the WINPROJ.DEV.HXS file and instructions to update VBA Help on the local computer. To access VBA Help, open the VBE in Project, and then click the Help icon or press F1. The VBA Help file for Project 2010 is the Microsoft Help 2.0 format WINPROJ.DEV.HXS file in the [Program Files]\Microsoft Office\Office14\[LCID] directory, where LCID is the locale ID. For example, the English VBA Help for Project is [Program Files]\Microsoft Office\Office14\1033\WINPROJDEV.HXS. To access updated VBA Help online, click the Connection Status menu in the lower-right corner of the Project Help window, and then select Show content from Office.com.
The Project 2010 SDK download includes an updated WINPROJ.DEV.HXS file and instructions for installing the update for local VBA Help. To use the local VBA Help file, click the Connection Status menu in the lower-right corner of the Project Help window, and then select Show content only from this computer.
The developer technologies and tools for automating Project 2010 include the VBE for recording and developing VBA macros and integrating with Microsoft Word 2010, Microsoft Excel 2010, and the hundreds of other applications that expose a VBA object model. The primary interop assembly for Project 2010 helps developers take advantage of the power and features of the Microsoft .NET Framework and integrate with the Project object model from managed assemblies.
Note
Methods that have changed parameters from previous versions of Project have Ex (for Extended) appended to the method name. When you record a macro in Project 2010, the macro uses the changed methods. For example, if you are recording a macro and close the project file, the macro records FileCloseEx.
See Also
Other Resources
Office Talk: Working with VBA in the 32-bit and 64-bit Versions of Office 2010
Visual Studio Developer Center