ProjectBeforeAssignmentNew Event
Occurs before one or more assignments are created.
Syntax
Private Sub object**_ProjectBeforeAssignmentNew(ByVal** pj As MSProject.Project, Cancel As Boolean)
object An object of type Application declared with events in a class module. For more information, see Using events with the Application object.
pj The project in which an assignment or assignments are being created.
Cancel False when the event occurs. If the event procedure sets this argument to True, the new assignment(s) are not created.
Remarks
The ProjectBeforeAssignmentNew event also fires when a resource assignment is replaced. Additionally, the event will fire when the only resource assignment on a task is removed, because an "Unassigned Resource" assignment is created after the existing assignment is removed.
Project events do not occur when the project is embedded in another document or application.
The ProjectBeforeAssignmentNew event doesn't occur when an assignment is created as the result of a drag-and-drop operation in the Resource Usage view, during resource pool operations, when inserting or removing a subproject, or when changes have been made using a custom form.
Applies to | Application Object
See Also | ProjectBeforeAssignmentChange Event | ProjectBeforeAssignmentDelete Event | ProjectBeforeAssignmentNew2 Event | ProjectBeforeResourceNew Event | ProjectBeforeTaskNew Event