ConstraintType Property
Returns or sets a constraint type for a task. Read/write Long.
PjConstraint
Constant | Constraint Type | Description |
---|---|---|
pjALAP | As Late As Possible | Task occurs as late as possible in the schedule without delaying subsequent tasks |
pjASAP | As Soon As Possible | Task occurs as soon as possible in the schedule. This is the default constraint type for tasks |
pjFNET | Finish No Earlier Than | Task finishes on or after the constraint date |
pjFNLT | Finish No Later Than | Task finishes on or before the constraint date |
pjMFO | Must Finish On | Task finishes on the constraint date |
pjMSO | Must Start On | Task starts on the constraint date |
pjSNET | Start No Earlier Than | Task starts on or after the constraint date |
pjSNLT | Start No Later Than | Task starts on or before the constraint date |
Remarks
If you set the ConstraintType property to pjFNET, pjFNLT, pjMFO, pjMSO, pjSNET, or pjSNLT, Microsoft Office Project 2003 uses the constraint date for the task. To set the constraint date, use the ConstraintDate property.
Example
The following example changes the constraint type of tasks from MSO and MFO to SNET and FNLT.
Sub ChangeConstraintTypes()
Dim T As Task ' Task object used in For Each loop
For Each T In ActiveProject.Tasks
If T.ConstraintType = pjMSO Then
T.ConstraintType = pjSNET
ElseIf T.ConstraintType = pjMFO Then
T.ConstraintType = pjFNLT
End If
Next T
End Sub
Applies to | Task Object, Tasks Collection Object
See Also | ConstraintDate Property | Priority Property | Subproject Property | WBS Property