Application.ToggleTPResourceExpand method (Project)

Expands or collapses the specified resource row in the Team Planner view, when there is more than one assignment within the same time span for the resource.

Syntax

expression. ToggleTPResourceExpand( _ResourceUniqueID_ )

expression An expression that returns an Application object.

Parameters

Name Required/Optional Data type Description
ResourceUniqueID Optional Long Unique identification number of the resource.

Return value

Boolean

Remarks

You can manually expand or collapse the list of tasks for a single resource, by choosing the + or ? icon next to the resource name. To do the same action for all resources, use the ToggleTPAutoExpand method.

Note

The + or ? icon does not show next to the resource name if there are no overlapping assignments for that resource.

The ToggleTPResourceExpand method corresponds to the Expand Resource Rows check box on the Format tab under Team Planner Tools in the ribbon, but affects only the specified resource.

Example

In the following example, the R2 resource has overlapping assignments. The ToggleTheResourceRow macro switches to the Team Planner view and expands or collapses the row for R2. When the row is expanded, it is easier to see all of the overlapping assignments.

Sub ToggleTheResourceRow() 
    Dim resourceUid As Long 
 
    ViewApplyEx Name:="Team Planner" 
 
    resourceUid = ActiveProject.Resources("R2").UniqueID 
    ToggleTPResourceExpand (resourceUid) 
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.