Report For Task Recurrance

Status
Not open for further replies.

Tomohawk

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
When setting recurrence for new tasks and depending on which "Recurrence Pattern" I select, I get different default settings in the "Range Of Recurrence", as follows:-

DAILY - "End By" radio button is selected and defaults to 84 days (have no idea why)

WEEKLY - "End By" radio button is selected and defaults to 168 days (have no idea why)

MONTHLY - "End By" radio button is selected and defaults to 12 months (have no idea why)

YEARLY - "No End Date" radio button is selected by default

I have hundreds of tasks with differing recurrences and I suspect that I have Daily, Weekly and Monthly tasks which I intended to have no end date, but saved the default, as above.

I would like a report of tasks (Daily/Weekly/Monthly) with recurrences that DO NOT have "No End Date" activated.

Just a list of tasks by Subject (ideally that I can click into and edit/save).

Recurrence.jpg
 
I have the same weird end by defaults - i thought it was something i set using GPO. <g>

I was going to suggest using the recurrence pattern field, but tasks doing have one. You'll need a macro. I'll see if i can find one.
 
The code below generates a list like this in a new message - the false at the end is no end date set - true would = end date. it needs some cleaning up, but my computer is goofy (windows updates waiting to install always makes it goofy.) so it hasn't been fully tested and needs cleaned up.

Test no (none) 6/7/2020 False
test 200 Weekly False 6/7/2020 False


Code:
Sub ShowRecurrencePattern_TaskList()
Dim objTaskFolder As Outlook.folder
Dim objRecurringTask As Outlook.TaskItem
Dim objItem As Object
Dim objRecurrencePattern As Outlook.RecurrencePattern
Dim strPattern As String
Dim objNewProperty As Outlook.UserProperty

'Get the default Tasks folder
Set objTaskFolder = Outlook.Application.Session.GetDefaultFolder(olFolderTasks)
For Each objItem In objTaskFolder.Items

If objItem.IsRecurring = True Then
Set objRecurringTask = objItem
Set objRecurrencePattern = objRecurringTask.GetRecurrencePattern

Select Case objRecurrencePattern.RecurrenceType
Case olRecursDaily
strPattern = "Daily"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

Case olRecursWeekly
strPattern = "Weekly"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

Case olRecursMonthly, olRecursMonthNth
strPattern = "Monthly"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

Case olRecursYearly, olRecursYearNth
strPattern = "Yearly"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

End Select

Else

strPattern = "(none)"
strregen = ""

End If

strTasks = objItem.Subject & vbTab & strPattern & vbTab & strregen & vbTab & strenddate & vbTab & strnodate & vbCrLf & strTasks & vbCrLf

Next

Set msgTasks = Application.CreateItem(olMailItem)

msgTasks.Body = strTasks

msgTasks.Display

End Sub
 
Thanks very much Diane.

I have no knowledge of using code, so I will need to get step-by-step assistance on how to operationalise this. Is it OK to share your code with others and seek assistance with a) "cleaning up" and b) operationalising it?
 
The code below generates a list like this in a new message - the false at the end is no end date set - true would = end date. it needs some cleaning up, but my computer is goofy (windows updates waiting to install always makes it goofy.) so it hasn't been fully tested and needs cleaned up.

Test no (none) 6/7/2020 False
test 200 Weekly False 6/7/2020 False


Code:
Sub ShowRecurrencePattern_TaskList()
Dim objTaskFolder As Outlook.folder
Dim objRecurringTask As Outlook.TaskItem
Dim objItem As Object
Dim objRecurrencePattern As Outlook.RecurrencePattern
Dim strPattern As String
Dim objNewProperty As Outlook.UserProperty

'Get the default Tasks folder
Set objTaskFolder = Outlook.Application.Session.GetDefaultFolder(olFolderTasks)
For Each objItem In objTaskFolder.Items

If objItem.IsRecurring = True Then
Set objRecurringTask = objItem
Set objRecurrencePattern = objRecurringTask.GetRecurrencePattern

Select Case objRecurrencePattern.RecurrenceType
Case olRecursDaily
strPattern = "Daily"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

Case olRecursWeekly
strPattern = "Weekly"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

Case olRecursMonthly, olRecursMonthNth
strPattern = "Monthly"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

Case olRecursYearly, olRecursYearNth
strPattern = "Yearly"
strregen = objRecurrencePattern.Regenerate
strenddate = objRecurrencePattern.PatternEndDate
strnodate = objRecurrencePattern.NoEndDate

End Select

Else

strPattern = "(none)"
strregen = ""

End If

strTasks = objItem.Subject & vbTab & strPattern & vbTab & strregen & vbTab & strenddate & vbTab & strnodate & vbCrLf & strTasks & vbCrLf

Next

Set msgTasks = Application.CreateItem(olMailItem)

msgTasks.Body = strTasks

msgTasks.Display

End Sub
Hi Diane.

I was wondering if we could pick this up and give me some additional instructions as to how to set up and run this code.

Thanks,
Tommy
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Diane Poremsky Send a Task Status Report Using Outlook 0
F Open task from is own status report in Public Folders Outlook VBA and Custom Forms 3
V Report Permission Exchange Server Administration 1
HarvMan Outlook 365 PST Report Using Outlook 1
D IMP.Note Versus REPORt.IPM.NOte Outlook VBA and Custom Forms 3
C Long List Of Outlook 2016/Outlook.com Bugs // Where To Report? Using Outlook 10
S Meeting room booking report Outlook VBA and Custom Forms 1
D How to Run a Report Based on Age of Inbox Items Outlook VBA and Custom Forms 0
V Report stuck formatting page Using Outlook 1
J Outlook 2007 Rules & VBA: How to run a script on a report message (ReportItem) Using Outlook 14
D Report on mailboxes which have exceeded quota? Exchange Server Administration 1
K report of Available hours for a team of staff from OUtlook Calenda Outlook VBA and Custom Forms 2
D Report from forms Outlook VBA and Custom Forms 3
T email Access report pop up network error Outlook VBA and Custom Forms 1
K BCM 2010 report error BCM (Business Contact Manager) 6
R Using 'Company Name' in a BCM report!! BCM (Business Contact Manager) 1
F company field won't show in report BCM (Business Contact Manager) 5
T Is any body knows how to add #company name# to report? BCM (Business Contact Manager) 1
J Modifying a Business Contact Manager Report BCM (Business Contact Manager) 1
H Error in values when exporting report to Excel BCM (Business Contact Manager) 1
sjbtax Update Task Custom Field based upon Task Overdue Status Outlook VBA and Custom Forms 8
B Requesting VBA code to make Outlook prompt for confirmation when deleting a task? Outlook VBA and Custom Forms 4
T Why do Outlook Desktop 2021 tasks from my wife's email show up in my task pane? Using Outlook 2
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
D Copy Appointment Body to Task Body Outlook VBA and Custom Forms 0
K Daily Task List Minimized Cannot Display Using Outlook 5
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 4
S Outlook 2016 Understand and customize prepended behavior of recurring task Using Outlook 0
B Outlook 365 Populate Outlook Task UDFs from a UDF text string Outlook VBA and Custom Forms 2
K Multiple copies of task being created Using Outlook 2
P Short Date Format when typing in a task Using Outlook 2
C Outlook 2013 Task Recurrence - Third Friday After the Second Tuesday Using Outlook 2
P Task display now leaves little room for notes Using Outlook 10
C-S-R How to clear an Outlook (To Do) Task Flag? Using Outlook 8
G Event when creating task from mailitem Outlook VBA and Custom Forms 2
P Changing the font that the task view shows Using Outlook 5
D How To Combine Share Task Folders in just one Folder Using Outlook 0
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
G Arggh, weakness of reminder for every Task recurrence Using Outlook 0
P Can't paste an image into a task Using Outlook 3
F Validation on custom task form after task acceptance Outlook VBA and Custom Forms 1
J Office 365 erased all of my task views Using Outlook 3
E Can't accept or decline task (no button appears) Using Outlook 2
Z VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
Z Task Filter Not Working When I add too many criteria Using Outlook 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
Z How to show concatenated categories in list task view? Using Outlook 2
Z VBA to Collapse Task Folder Groups Outlook VBA and Custom Forms 1
E To convert imported data to custom fields in Task list Outlook VBA and Custom Forms 1
I Help with dates in task list. Using Outlook 5

Similar threads

Back
Top