Colortasks.mmbas

From ActivityOwnerWiki
Jump to: navigation, search
'ColorTasks  21Oct2007   http://www.activityowner.com  http://creativecommons.org/licenses/by-sa/2.5/
'color overdue red, upcoming yellow, and others green
Sub Main
	Dim t As Topic
	For Each t In ActiveDocument.Range(mmRangeAllTopics)
		If t.Task.Complete=100 Then
				t.FillColor.SetARGB(255,0,255,0)
		ElseIf t.Task.DueDate>0 Then
			If  t.Task.DueDate<Date() Then
				t.FillColor.SetARGB(255,255,0,0)
			ElseIf t.Task.DueDate<(Date()+7) Then
				t.FillColor.SetARGB(255,255,255,0)
			ElseIf t.Task.Complete>-1 Then
				t.FillColor.SetARGB(255,0,255,0)
			End If
		End If
	Next
End Sub