Task.FixedCost 属性 (Project)

获取或设置任务的固定成本。 可读/写 Variant 类型。

语法

expressionFixedCost

表达 一个代表 Task 对象的变量。

示例

下例将标记任务的固定成本按用户指定的数量增加。

Sub IncreaseFixedCosts() 
 
 Dim T As Task ' Task object used in For Each loop 
 Dim Entry As String ' Amount to add to any existing fixed cost 
 
 Entry = InputBox$("Increase the fixed costs of marked tasks by what amount?") 
 
 ' If entry is invalid, display error message and exit Sub procedure. 
 If Not IsNumeric(Entry) Then 
 MsgBox ("You didn't enter a numeric value.") 
 Exit Sub 
 End If 
 
 ' Increase the fixed costs of marked tasks by the specified amount. 
 For Each T In ActiveProject.Tasks 
 If T.Marked Then 
 T.FixedCost = T.FixedCost + Val(Entry) 
 End If 
 Next T 
 
End Sub

支持和反馈

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