Table of contents
TOC
Collapse the table of content
Expand the table of content

TaskGroups2 Object (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Represents all the task-based group definitions, where group hierarchy can be maintained. TaskGroups2 is a collection of Group2 objects.

Example

Using the TaskGroups2 Collection

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

Dim tg2 As Group2
Dim tGroups2 As String

For Each tg2 in ActiveProject.TaskGroups2  
    tGroups2 = tGroups2 & tg2.Name & vbCrLf  
Next tg2  

MsgBox tGroups2

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

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

Methods

Name
Add
Copy

Properties

Name
Application
Count
Item
Parent

See also

Other resources

Project Object Model

© 2017 Microsoft