Sunday, October 10, 2010

Create Full WBS Structure in MSP 2007

Recently got a requirement to create the Full WBS structure with the Task Names in the MSP 2007.

Following is the Macro to achieve the same:

Sub Test()
Dim str As String
Dim t As Task
Dim OutlineLevel As Integer
OutlineLevel = 1
While OutlineLevel < 15
For Each t In ActiveProject.Tasks
If Not (t Is Nothing) Then
If t.OutlineLevel = OutlineLevel Then
t.Text10 = t.OutlineParent.Text10 & "." & t.Name
End If
End If
Next t
OutlineLevel = OutlineLevel + 1
Wend
End Sub

And we are done, It has helped when i was suppose to give data back to my client where they needed the Full path so they can map it with their actual data.
Hope this will help someone.. J

No comments: