Task.Summary 属性 (Project)

如此 如果任务为摘要任务。 只读 Boolean

语法

表达式总结

表达 一个代表 Task 对象的变量。

示例

下面的示例检查活动项目中的摘要任务是否有工作分配。

注意

[!注释] 摘要任务中不应进行工作分配。

Sub CheckAssignmentsOnSummaryTasks() 
 Dim tsk As Task 
 Dim message As String 
 Dim numAssignments As Integer 
 Dim numSummaryTasksWithAssignments As Integer 
 Dim msgStyle As VbMsgBoxStyle 
 
 message = "" 
 numSummaryTasksWithAssignments = 0 
 
 For Each tsk In ActiveProject.Tasks 
 If tsk.Summary Then 
 numAssignments = tsk.Assignments.Count 
 If numAssignments > 0 Then 
 message = message & "Summary task ID (" & tsk.ID & "): " & tsk.Name _ 
 & ": " & numAssignments & " assignments" & vbCrLf 
 numSummaryTasksWithAssignments = numSummaryTasksWithAssignments + 1 
 End If 
 End If 
 Next tsk 
 
 If numSummaryTasksWithAssignments > 0 Then 
 message = "There are " & numSummaryTasksWithAssignments _ 
 & " summary tasks that have assignments." & vbCrLf & vbCrLf & message 
 msgStyle = vbExclamation 
 Else 
 message = "No summary tasks have assignments." 
 msgStyle = vbInformation 
 End If 
 
 MsgBox message, msgStyle, "Summary Task Check" 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。