Task.ConstraintType property (Project)

Gets or sets a constraint type for a task. Read/write Variant.

Syntax

expression. ConstraintType

expression A variable that represents a Task object.

Remarks

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.

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.