Share via


Task.ConstraintDate Property

Project Developer Reference

Returns or sets a constraint date for a task. Read/write Variant.

Syntax

expression.ConstraintDate

expression   A variable that represents a Task object.

Example
The following example sets the constraint type to SNET and the constraint date to the current date for tasks in the active project with the default constraint of ASAP.

Visual Basic for Applications
  Sub SetConstraintDate()
    Dim T As Task   ' Task object used in For Each loop
For Each T In ActiveProject.Tasks
    If T.ConstraintType = pjASAP Then
        T.ConstraintType = pjSNET
        T.<strong class="bterm">ConstraintDate</strong> = ActiveProject.CurrentDate
    End If
Next T

End Sub

See Also