1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| Sub outline()
Dim T As Task
Dim PJ As Project
Dim App As Application
Set App = MSProject.Application
Set PJ = ActiveProject
With App
.ScreenUpdating = False 'Attempt to stop the screen refreshing'
.FilterApply "&All tasks"
.OutlineHideSubTasks
.OutlineShowAllTasks
For Each T In PJ.Tasks
If Not (T Is Nothing) Then
If T.Summary = True Then
If T.OutlineLevel = 1 Then
SelectRow Row:=T.ID, Rowrelative:=False
Font32Ex CellColor:=2630610
Font32Ex Color:=16777215
Font32Ex Name:="Calibri"
Font32Ex Size:="12"
End If
If T.OutlineLevel = 2 Then
SelectRow Row:=T.ID, Rowrelative:=False
Font32Ex CellColor:=10092543
Font32Ex Color:=0
Font32Ex Name:="Calibri"
Font32Ex Size:="10"
End If
If T.OutlineLevel = 3 Then
SelectRow Row:=T.ID, Rowrelative:=False
Font32Ex CellColor:=10085886
Font32Ex Color:=0
Font32Ex Name:="Calibri"
Font32Ex Size:="10"
End If
If T.OutlineLevel > 3 Then
SelectRow Row:=T.ID, Rowrelative:=False
Font32Ex Name:="Calibri"
Font32Ex Size:="10"
Font32Ex Color:=0
Font32Ex CellColor:=-16777216
End If
Else
SelectRow Row:=T.ID, Rowrelative:=False
Font32Ex Name:="Calibri"
Font32Ex Size:="10"
Font32Ex Color:=0
Font32Ex CellColor:=-16777216
End If
End If
Next T
SelectRow Row:=0, Rowrelative:=False
Font32Ex CellColor:=2630610
Font32Ex Color:=16777215
Font32Ex Name:="Calibri"
Font32Ex Size:="12"
.ScreenUpdating = True
.FilterApply "&All tasks"
.OutlineHideSubTasks
.OutlineShowAllTasks
End With
End Sub |
Partager