NEED HELP on Split tasks on VBA Project

  • Thread starter Hernán Piñón Arias
  • Start date
H

Hernán Piñón Arias

Hi everibody!

I'm reading several tasks on a Project 2003 .mpp file with VBA tasks'object
and when I found a split task I don't know how to realize that:
1.- This is a split task
2.- In how many parts it is split
3.- Which is the beginning and the end date/time of each part of the task.

Thanks for any help

Hernán
 
J

Jan De Messemaeker

Hi,

Here is the help that will... help :)

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

Using the SplitPart Object

Use SplitParts(Index), where Index is the task portion index number, 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.

ActiveCell.Task.Split "10/2/02", "10/7/02"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top