Here is a basic example of how to format the boxes (nodes) in a network diagram view. This code sets the background color of the box based on the task's priority. The BoxFormat method can also format gridlines, border styles, etc.
Sub FormatBoxes()
ViewApply Name:="Network Diagram"
Dim t As Task
For Each t In ActiveProject.Tasks
Select Case t.Priority
Case Is <= 100
BoxFormat TaskID:=t.ID, BackgroundColor:=pjFuchsia
Case Is <= 300
BoxFormat TaskID:=t.ID, BackgroundColor:=pjBlue
Case Is <= 500
BoxFormat TaskID:=t.ID, BackgroundColor:=pjYellow
Case Else
BoxFormat TaskID:=t.ID, BackgroundColor:=pjRed
End Select
Next t
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…