task being updated............
You're right....however we need to keep track of changes in the tasks
over the last 14 days. So we need to be able to see on which days the
last 14 days a certain task has been updated and more important on
which days not....
That's why we write the date of the change in the body like this:
Function AddDates(ByVal TaskSubject As String, _
ByVal TaskBody As String, _
ByVal fnYear As String, _
ByVal fnMonth As String, _
ByVal fnDay As String) As String
Dim x As Long
Dim FirstDate As Date
Dim RecordDate As Date
Dim Records() As String
Records = Split(TaskBody, vbCrLf)
For x = 0 To UBound(Records)
'eerst even de eerste twee regels leegmaken
If Records(0) Like "" Then Records(0) = "X\X/X"
If Records(1) Like "------------" Then Records(1) = "X\X/X"
If Records(x) Like "########" Then
RecordDate = Format(Records(x), "@@@@-@@-@@")
If InStr(TaskSubject, "WEEKLY") 0 Then
If DateDiff("d", RecordDate, Date) = 30 Then
Records(x) = "X\X/X"
End If
Else
If DateDiff("d", RecordDate, Date) = 14 Then
Records(x) = "X\X/X"
End If
End If
End If
Next
TaskBody = Join(Records, vbCrLf)
Do While InStr(TaskBody, "X\X/X" & vbCrLf) 0
TaskBody = Replace$(TaskBody, "X\X/X" & vbCrLf, "")
Loop
AddDates = fnYear & fnMonth & fnDay & vbCrLf & TaskBody
End Function
Marco
|