ResourceGroups2 对象 (Project)

表示所有基于资源组定义,可在其中维护组层次结构。 ResourceGroups2组 2 的对象的集合。

示例

使用 ResourceGroups2 集合

使用 ResourceGroups2 属性返回一个 ResourceGroups2 集合。 下面的示例将列出活动项目中所有资源组的名称。

Dim rg2 As Group2  
Dim rGroups2 As String  
  
For Each rg2 in ActiveProject.ResourceGroups2  
    rGroups2 = rGroups2 & rg2.Name & vbCrLf  
Next rg2  
  
MsgBox rGroups2

使用 Add 方法可向 ResourceGroups2 集合中添加一个 组 2 。 下面的示例创建新的组的组资源通过它们的标准费率,再修改准则,以便资源按降序排序。

ActiveProject.ResourceGroups2.Add "Resources by Rate", "Standard Rate"  
ActiveProject.ResourceGroups2("Resources by Rate").GroupCriteria(1).Ascending = False

方法

名称
Add
Copy

属性

名称
Application
Count
项目
Parent

另请参阅

项目对象模型

支持和反馈

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