task being updated............

  • Thread starter Thread starter vonClausowitz
  • Start date Start date
V

vonClausowitz

Hi All,

I found out that when a task is clicked away as completed that in the
body at the second line there is 12 dashes added, like this:

------------

Now I want to change this. I don't want the dashes added. Is there
anything I can change to prevent this?
The point is that i run a code that checks the dates in my task body
and these line is not a date.
Now I get stuff like:

20060202
 
Sorry Marco, there's no way to change that behaviour. You're only recourse
is to programmatically modify the changes in the body, but it wouldn't really
be practical in my opinion.
 
What if the two lines are added to the body?
Will it keep adding them to it everytime the task is completed or just
once?
If not then I could just leave it in and start filling in my dates at
line three.
Like:
 
If your ultimate goal is to capture the date that assigned Tasks are
completed, monitor the changes in the original Task item itself. This item
has the DataCompleted property in the Object Model; far better than reading
it in the message body of a task update message.
 
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
 
Back
Top