Application.NewProject Event (Project)

Occurs when a new project is created, including the default project created each time Microsoft Project 2010 starts.

Syntax

expression .NewProject(pj, )

expression A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

pj

Required

Project

The project that was created.

Remarks

The NewProject event for the default project is analogous to the Open event for existing projects. The NewProject event occurs before the Activate event for a new project. Project events do not occur when the project is embedded in another document or application. For more information and sample code for creating and testing an event handler, see Using Events with Application and Project Objects.

Example

The following example sets the number of working hours per day for every new project created. This example requires a new class module and additional code for it to have an effect.

Private Sub App_NewProject(ByVal pj As MSProject.Project) 
 pj.HoursPerDay = 10 
End Sub