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