TaskGroups Collection Object

Project
TaskGroups
Group

Represents all the task-based group definitions.

Using the TaskGroups Collection

Use the TaskGroups property to return a TaskGroups collection. The following example lists the names of all the task groups in the active project.

Dim TG As Group
Dim Groups As String

For Each TG in ActiveProject.TaskGroups
    Groups = Groups & TG.Name & vbCrLf
Next TG

MsgBox Groups

Use the Add method to add a Group object to the TaskGroups collection. The following example creates a new group that groups tasks by whether they are overallocated or not and then modifies the criterion so that overallocated tasks are sorted in descending order.

ActiveProject.TaskGroups.Add "Overallocated Tasks", "Overallocated"
ActiveProject.TaskGroups("Overallocated Tasks").GroupCriteria(1).Ascending = False

Properties | Application Property | Count Property | Item Property | Parent Property

Methods | Add Method | Copy Method

Parent Objects | Project Object, Projects Collection Object

Child Objects | Group Object, Groups Collection Object

See Also | ResourceGroups Property | TaskGroups Property