Table of contents
Collapse the table of content
Expand the table of content

Task.ConstraintType Property (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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
© 2018 Microsoft