Task.ConstraintDate property (Project)

Gets 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.

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.ConstraintDate = ActiveProject.CurrentDate 
        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.