Share via


Task.Priority Property

Project Developer Reference

Returns or sets a priority for the specified project (Project object) or task (Task object). Read/write Variant. Can be a value from 0 to 1000 or one of the PjPriority constants.

Syntax

expression.Priority

expression   A variable that represents a Task object.

Remarks

Microsoft Office Project 2007 uses this property to determine how to treat tasks when leveling resources across multiple projects. If two projects have equivalent priorities, the Priority property for individual tasks is used.

Example
The following example sets the tasks on the critical path to the highest priority in the active project.

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

' Look for tasks on the critical path.
For Each T In ActiveProject.Tasks
    If T.Critical = True Then
        T.<strong class="bterm">Priority</strong> = 900
    End If
Next T

End Sub

See Also