Skip to content

Latest commit

 

History

History
48 lines (28 loc) · 1.52 KB

Project.Application.NewProject.md

File metadata and controls

48 lines (28 loc) · 1.52 KB
title ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.NewProject event (Project)
project-server
Project.Application.NewProject
de3c9e06-405a-8f63-6210-013f5d292c20
06/08/2017
medium

Application.NewProject event (Project)

Occurs when a new project is created, including the default project that is created each time Project 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 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.

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

[!includeSupport and feedback]