Project) (Assignment.Peak 属性
获取工作分配的资源单位的最大数目。 只读变体。
语法
expression。 Peak
表达 一个代表 Assignment 对象的变量。
示例
下面的示例将查找分配了超过特定数量资源单位的任何工作分配。
Sub FindOverassigned()
Dim T As Task, A As Assignment
Dim TooMany As Double, Results As String
TooMany = InputBox("Enter maximum allowed units per assignment: ")
For Each T In ActiveProject.Tasks
If Not (T Is Nothing) Then
For Each A In T.Assignments
If A.Peak > TooMany Then
Results = Results & T.Name & ": " & A.ResourceName & vbCrLf
End If
Next A
If Results <> "" Then MsgBox "The following resources are " & _
"assigned more than " & TooMany & " units:" & vbCrLf & Results
Results = ""
End If
Next T
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。