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

SplitPart 对象 (项目)SplitPart Object (Project)

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

表示任务的某一部分。SplitPart对象是SplitParts集合的一个成员。Represents a task portion. The SplitPart object is a member of the SplitParts collection.

示例Examples

使用 SplitPart 对象Using the SplitPart Object

使用SplitParts索引),其中索引是索引号任务部分,可返回一个SplitPart对象。下面的示例列出开始和完成每个任务部分的活动单元格中任务的时间。Use SplitParts (Index ), whereIndex is the index number of the task portion, to return a single SplitPart object. The following example lists the start and finish times of each task portion of the task in the active cell.

Dim Part As Long, Portions As String

For Part = 1 To ActiveCell.Task.SplitParts.Count
    With ActiveCell.Task
        Portions = Portions & "Task portion " & Part & ": Start on " & _
            .SplitParts(Part).Start & ", Finish on " & _
            .SplitParts(Part).Finish & vbCrLf
    End With
Next Part

MsgBox Portions

使用 SplitParts 集合Using the SplitParts Collection

使用SplitParts属性返回一个SplitParts集合。下面的示例返回活动项目中每个任务的任务部分的数目。Use the SplitParts property to return a SplitParts collection. The following example returns the number of task portions for each task in the active project.

Dim T As Task

For Each T In ActiveProject.Tasks
    If Not (T Is Nothing) Then
        MsgBox T.Name & ": " & T.SplitParts.Count
    End If

Next T

使用拆分方法 ( Task对象) SplitParts集合中添加一个SplitPart对象。(拆分方法会创建一个拆分任务中。下面的示例将从星期三到星期一,在 2012 年 10 月的任务拆分。Use the Split method ( Task object) to add a SplitPart object to the SplitParts collection. (The Split method creates a split in a task.) The following example creates a split in the task from Wednesday to Monday, in October of 2012.

ActiveCell.Task.Split "10/3/2012", "10/8/2012"

方法Methods

名称Name
DeleteDelete

属性Properties

名称Name
ApplicationApplication
完成Finish
IndexIndex
ParentParent
StartStart
© 2018 Microsoft