title | ms.service | api_name | ms.assetid | ms.date | ms.localizationpriority | |
---|---|---|---|---|---|---|
Application.NewProject event (Project) |
project-server |
|
de3c9e06-405a-8f63-6210-013f5d292c20 |
06/08/2017 |
medium |
Occurs when a new project is created, including the default project that is created each time Project starts.
expression. NewProject
( _pj_
)
expression A variable that represents an Application object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
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 don't 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
[!includeSupport and feedback]