Table of contents
TOC
折叠目录
展开目录

Task.StartVariance 属性 (项目)Task.StartVariance Property (Project)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

获取比较基准开始日期与任务的开始日期之间的差异 (以分钟为单位)。只读变量Gets the variance (in minutes) between the baseline start date and the start date of the task. Read-only Variant.

语法Syntax

表达式StartVarianceexpression. StartVariance

表达式_一个表示任务对象的变量。_expression A variable that represents a Task object.

示例Example

以下示例显示活动项目中滞后开始的任务的个数和任务名。The following example displays the number of tasks and task names in the active project that have started late.

Sub CountLateTasks() 

 Dim t As Task 
 Dim numLateTasks As Long 
 Dim lateTasks As String 
 Dim daysLate As Single 

 numLateTasks = 0 

 ' Look for late tasks in the active project. 
 For Each t In ActiveProject.Tasks 
 If t.BaselineStart < ActiveProject.CurrentDate And t.StartVariance > 0 Then 
 numLateTasks = numLateTasks + 1 
 daysLate = Round(t.StartVariance / 1440, 1) 
 lateTasks = lateTasks &; vbCrLf &; vbTab &; t.Name _ 
 &; ": " &; daysLate &; " days" 
 End If 
 Next t 

 MsgBox "There are " &; numLateTasks &; " late tasks in this project: " &; lateTasks 

End Sub
© 2018 Microsoft