G
ggarmon
I have the following peice of code that changes text color based on
the task status (thanks Jan). The code works fine except when I
expand a linked project. The tasks in the linked project do not
appear in the correct colors. Is there a way to remedy that? The
code runs when the project is opened.
Private Sub Project_Open(ByVal pj As Project)
ViewApply "Gantt Chart"
FilterApply "All Tasks"
OutlineShowAllTasks
For Each Tsk In ActiveProject.Tasks
If Not Tsk Is Nothing Then
Select Case Tsk.Status
Case pjLate
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjRed
Case pjComplete
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjGreen
Case pjOnSchedule
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjBlue
Case Else
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjBlack
End Select
End If 'Nothing
Next Tsk
SendKeys ("^{HOME},^s")
End Sub
the task status (thanks Jan). The code works fine except when I
expand a linked project. The tasks in the linked project do not
appear in the correct colors. Is there a way to remedy that? The
code runs when the project is opened.
Private Sub Project_Open(ByVal pj As Project)
ViewApply "Gantt Chart"
FilterApply "All Tasks"
OutlineShowAllTasks
For Each Tsk In ActiveProject.Tasks
If Not Tsk Is Nothing Then
Select Case Tsk.Status
Case pjLate
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjRed
Case pjComplete
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjGreen
Case pjOnSchedule
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjBlue
Case Else
SelectRow Row:=Tsk.ID, RowRelative:=False
Font Color:=pjBlack
End Select
End If 'Nothing
Next Tsk
SendKeys ("^{HOME},^s")
End Sub