title | keywords | f1_keywords | ms.service | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|---|
Task.ConstraintType property (Project) |
vbapj.chm131667 |
|
project-server |
|
cdcd6a0d-a996-646d-130e-1a5ed2c93705 |
06/08/2017 |
medium |
Gets or sets a constraint type for a task. Read/write Variant.
expression. ConstraintType
expression A variable that represents a Task object.
The ConstraintType property can be one of the PjConstraint constants.
If you set the ConstraintType property to pjFNET, pjFNLT, pjMFO, pjMSO, pjSNET, or pjSNLT, Project uses the constraint date for the task. To set the constraint date, use the ConstraintDate property.
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
[!includeSupport and feedback]