Task.GroupBySummary Property (Project)

True , wenn sich das ausgewählte Element in einer Aufgabenansicht in einer Gruppenzusammenfassungszeile befindet. andernfalls False. Schreibgeschützter boolescher Wert.

Syntax

Ausdruck. GroupBySummary

Ausdruck Eine Variable, die ein Task-Objekt darstellt.

HinwBemerkungeneise

Wenn Sie einen Befehl Gruppieren nach einer Vorgangsansicht anwenden, anzeigen die Gruppe Sammelvorgangszeilen Definition der in der Spalte Name des Vorgangs. GroupBySummary -Eigenschaft ist True, wenn eine ausgewählte Zelle in einer Gruppe Hauptzeile befindet.

GroupBySummary -Eigenschaft ist, kann über die ActiveCell.Task -Eigenschaft, nicht über ActiveProject.Tasks(x).

Beispiel

The following example applies the Duration grouping to the Gantt Chart view, and then selects the first cell in each row of the view and tests whether the row is a group summary. The process continues until the row is empty, and then shows a message box with the test results for each row.

Sub ShowGroupByItems() 
 Dim isValid As Boolean 
 Dim tsk As Task 
 Dim rowType As String 
 Dim msg As String 
 
 isValid = True 
 msg = "" 
 
 ActiveProject.Views("Gantt Chart").Apply 
 GroupApply Name:="Duration" 
 Application.SelectBeginning 
 
 ' When a cell in an empty row is selected, accessing the ActiveCell.Task 
 ' property results in error 1004. 
 On Error Resume Next 
 
 ' Loop until a cell in an empty row is selected. 
 While isValid 
 Set tsk = ActiveCell.Task 
 
 If Err.Number > 0 Then 
 isValid = False 
 Debug.Print Err.Number 
 Err.Number = 0 
 Else 
 If tsk.GroupBySummary Then 
 rowType = "' is a group-by summary row." 
 Else 
 rowType = "' is a task row." 
 End If 
 
 msg = msg & "Task name: '" & tsk.Name & rowType & vbCrLf 
 SelectCellDown 
 End If 
 Wend 
 
 MsgBox msg, vbInformation, "GroupBy Summary for Tasks" 
 
End Sub

Support und Feedback

Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.