Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   task being updated............ (http://www.outlookbanter.com/outlook-vba/7426-task-being-updated.html)

vonClausowitz February 10th 06 03:29 PM

task being updated............
 
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

------------
20060201
etc...

Marco


Eric Legault [MVP - Outlook] February 10th 06 08:48 PM

task being updated............
 
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.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"vonClausowitz" wrote:

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

------------
20060201
etc...

Marco



vonClausowitz February 10th 06 09:21 PM

task being updated............
 
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:

------------
20060202

Marco


Eric Legault [MVP - Outlook] February 10th 06 09:48 PM

task being updated............
 
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.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"vonClausowitz" wrote:

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:

------------
20060202

Marco



vonClausowitz February 11th 06 09:00 AM

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



All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com