Recurrence Pattern Capture of Outlook Task to Excel
I’ve written code to run through my Outlook(2000 and 2002) Tasks folder and write the tasks to an Excel spreadsheet and its working well. [I won’t post all the code here because its lengthy, but if anyone wants it, just ask.]
After initiating excel and outlook and getting the right folder, all the fields, including user-defined fields, are written to separate coulmns in Excel and the only properties I am not able to capture are the recurrence patterns. Has anyone else already written code for this???
Since the recurring task pattern can be based on recurring daily, weekly, monthly, yearly and again on every n th day or n weeks, n months, n years….I figure I have to write an If…then to loop through all possibilities and then write the values as a string to excel?
My code is pretty easy –
intRow = 1
For Each objItem In objTaskItems.Items
If objItem.Class = olTask Then
objWS.Cells(intRow, 2) = objItem.UserProperties("ID Number")
objWS.Cells(intRow, 3) = objItem.Categories
objWS.Cells(intRow, 4) = objItem.Subject
objWS.Cells(intRow, 5) = objItem.Body
objWS.Cells(intRow, 6) = objItem.DueDate
If objItem.Delegator = True Then
objWS.Cells(intRow, 7) = objItem.Delegator
End If
If objItem.IsRecurring = True Then……………..???
Now how do I make sense out of the recurrence? I have used
objWS.Cells(intRow, 8) = objItem.GetRecurrencePattern.Interval & "--" __ & objItem.GetRecurrencePattern.RecurrenceType
objWS.Cells(intRow, 9) = objItem.GetRecurrencePattern.DayOfMonth
but these return numbers without knowing if they are months, days, etc.
Anyone out there already dealt with this and have some code available??? :confused:
http://images.outsourcecorp.com/runtoto.gif