Table of contents
TOC
折叠目录
展开目录

OverAllocatedAssignments 对象 (项目)OverAllocatedAssignments Object (Project)

office 365 dev account|上次更新日期: 2017/9/25
|
1 参与者

表示资源过度分配的工作分配对象的集合。Represents a collection of Assignment objects where the resource is overallocated.

注解Remarks

使用Item属性来获取OverAllocatedAssignments集合中的单个工作分配对象。Use the Item property to get a single Assignment object from the OverAllocatedAssignments collection.

示例Example

下面的示例查找工作分配过度分配资源所在。OverPeak 参数为False,过度分配时不大于可用资源的最大时间 (100%)。如果将 overPeak 设置为True,则查找过度分配的工作分配超过可用,如 150%的资源的最大时间。The following example finds assignments where the resource is overallocated. When the overPeak argument is False, the overallocation is not greater than the maximum resource time available (100%). If you set overPeak to True, the example finds overallocated assignments that exceed maximum resource time available, such as 150%.

Sub FindOverallocatedAssignments()  
    Dim t As Task  
    Dim a As Assignment  
    Dim overAlloc As OverAllocatedAssignments  
    Dim numOver As Long  
    Dim overPeak As Boolean  

    overPeak = False  

    For Each t In ActiveProject.Tasks  
        If t.Overallocated Then  
            Set overAlloc = t.StartDriver.OverAllocatedAssignments(overPeak)  
            numOver = overAlloc.Count  
            totalNumOver = overAlloc.TotalDetectedCount  

            For Each a In overAlloc  
                Debug.Print "Resource: " & a.Resource.Name & " is overallocated on task: " & t.Name  
                Debug.Print vbTab & "Number of overallocated assignments: " & numOver  
            Next a  
        End If  
    Next t  
End Sub

属性Properties

名称Name
ApplicationApplication
CountCount
ItemItem
ParentParent
TotalDetectedCountTotalDetectedCount

另请参阅See also

其他资源Other resources

项目对象模型Project Object Model

© 2018 Microsoft