Share via


Task.ConstraintType Property

Project Developer Reference

Returns or sets a constraint type for a task. Read/write Variant. Can be one of the PjConstraint constants.

Syntax

expression.ConstraintType

expression   A variable that represents a Task object.

Remarks

If you set the ConstraintType property to pjFNET, pjFNLT, pjMFO, pjMSO, pjSNET, or pjSNLT, Microsoft Office Project 2007 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.

Visual Basic for Applications
  Sub ChangeConstraintTypes()
Dim T As Task   ' Task object used in For Each loop

For Each T In ActiveProject.Tasks
    If T.<strong class="bterm">ConstraintType</strong> = pjMSO Then
        T.<strong class="bterm">ConstraintType</strong> = pjSNET
    ElseIf T.<strong class="bterm">ConstraintType</strong> = pjMFO Then
        T.<strong class="bterm">ConstraintType</strong> = pjFNLT
    End If
Next T

End Sub

See Also