Application.NewProject event (Project)
Occurs when a new project is created, including the default project that is created each time Project starts.
expression A variable that represents an Application object.
|pj||Required||Project||The project that was created.|
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.
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.