PayRate 对象 (Project)
代表资源成本费率表中的一个费率行。 PayRate 对象是 PayRates 集合的成员之一。
使用 PayRate 对象
使用 PayRates (Index ) ,其中Index 是返回其有效费率的工资率指数编号或日期,以返回单个 PayRate 对象。 以下示例返回成本费率表 C 中 Tamara 的第一个费率行的标准费率
ActiveProject.Resources("Tamara").CostRateTables("C").PayRates(1).StandardRate
使用 PayRates 集合
使用 PayRates 属性可以返回一个 PayRates 集合。 以下示例将列出活动单元格中资源的所有成本费率表的标准支付费率。
Dim CRT As CostRateTable
DIM PR As PayRate
Dim Rates As String
For Each CRT In ActiveCell.Resource.CostRateTables
For Each PR In CRT.PayRates
Rates = Rates & "CostRateTable " & CRT.Name & ": " & PR.StandardRate & vbCrLf
Next PR
Next CRT
MsgBox Rates
使用 Add 方法可向 PayRates 集合中添加一个 PayRate 对象。 下面的示例将一行添加到 Tamara 的成本费率表"C"具有有效日期的 2012 年 9 月 1 日 $40.00 标准费率每小时,加班费率为每小时,60.00 美元和每次使用成本为 ¥ 0。
ActiveProject.Resources("Tamara").CostRateTables("C").PayRates.Add "9/1/2012", "$40/h", "$60/h", "$0"
方法
名称 |
---|
Delete |
属性
名称 |
---|
Application |
CostPerUse |
EffectiveDate |
索引 |
OvertimeRate |
Parent |
StandardRate |
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。