SplitPart object (Project)

Represents a task portion. The SplitPart object is a member of the SplitParts collection.

Examples

Using the SplitPart Object

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

Using the SplitParts Collection

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

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
Delete

Properties

Name
Application
Finish
Index
Parent
Start

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.