Project (的 GroupCriterion 物件)
代表群組定義的準則。 GroupCriterion 物件是 GroupCriteria 集合的成員。
註解
若要使用群組階層可以維護,而且儲存格色彩可以是十六進位值的群組,請參閱 GroupCriterion2 物件。
範例
使用 GroupCriterion 物件
使用 **GroupCriteria (**Index) ,其中Index 是準則索引,可傳回單一 GroupCriterion 物件。 下列範例會設定為藍色標準工資率資源群組中的第一個準則的儲存格色彩。
ActiveProject.ResourceGroups("Standard Rate").GroupCriteria(1).CellColor = pjBlue
使用 GroupCriteria 集合
使用 GroupCriteria 屬性可以傳回 GroupCriteria 集合。 下面範例會顯示在指定的任務群組中,做為準則使用的欄位清單,並指出這些欄位是按遞增或遞減順序排序。
Dim GC As GroupCriterion
Dim Fields As String
For Each GC In ActiveProject.TaskGroups("Priority Keeping Outline Structure").GroupCriteria
If GC.Ascending = True Then
Fields = Fields & GC.Index & ". " & GC.FieldName & " is sorted in ascending order." & vbCrLf
Else
Fields = Fields & GC.Index & ". " & GC.FieldName & " is sorted in descending order." & vbCrLf
End If
Next GC
MsgBox Fields
使用 Add 方法可以將 GroupCriterion 物件新增到 GroupCriteria 集合中。 下面範例會將另一條準則新增到指定的資源群組中,並根據已完成工時百分比 (以 25% 為遞增值) 的遞增順序來決定資源的群組。
ActiveProject.ResourceGroups("Response Pending").GroupCriteria.Add "% Work Complete", True, CellColor:=pjRed, GroupOn:=pjGroupOnPct1_25
方法
名稱 |
---|
Delete |
屬性
名稱 |
---|
Application |
遞增排序 |
工作分派 |
CellColor |
FieldName |
FontBold |
FontColor |
FontItalic |
FontName |
FontSize |
FontUnderLine |
GroupInterval |
GroupOn |
Index |
Parent |
Pattern |
StartAt |
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。