I have run into an issue that I hope can be solved.
I am using code in access to create 4 tasks in Outlook for a team to work on.
I tried to use the mileage field in the tasks to find them quickly since from Access I have a case number but the issue I have run into is that since they are related cases I tried to add decimal points to the mileage for the additional related tasks.
So for case 1 there would be.
task 1 with mileage 1
task 1a with mileage 1.21
task 1b with mileage 1.22
task 1c with mileage 1.23
When I use my code to delete the task when it has been completed in the DB it will remove the first task without the decimal places but it will not remove the tasks with the decimal points.
here is a sample of the code in question:
Private Sub rm_30_day_retaliate_review_Click()
Const olFolderTasks = 13
Dim objOwner As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set NS = objOutlook.GetNamespace("MAPI")
Set objOwner = NS.CreateRecipient("user")
objOwner.Resolve
If objOwner.Resolved Then
MsgBox objOwner.Name
MsgBox NS.CurrentUser
Set newTaskFolder = NS.GetSharedDefaultFolder(objOwner, olFolderTasks)
Set colItems = newTaskFolder.Items
strFilter = "[Mileage] = " & Me.Case_Number + 0.21
MsgBox strFilter
Set colTasks = colItems.Restrict(strFilter)
For Each objTask In colTasks
objTask.Delete
Next
End If
End Sub
I am using code in access to create 4 tasks in Outlook for a team to work on.
I tried to use the mileage field in the tasks to find them quickly since from Access I have a case number but the issue I have run into is that since they are related cases I tried to add decimal points to the mileage for the additional related tasks.
So for case 1 there would be.
task 1 with mileage 1
task 1a with mileage 1.21
task 1b with mileage 1.22
task 1c with mileage 1.23
When I use my code to delete the task when it has been completed in the DB it will remove the first task without the decimal places but it will not remove the tasks with the decimal points.
here is a sample of the code in question:
Private Sub rm_30_day_retaliate_review_Click()
Const olFolderTasks = 13
Dim objOwner As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set NS = objOutlook.GetNamespace("MAPI")
Set objOwner = NS.CreateRecipient("user")
objOwner.Resolve
If objOwner.Resolved Then
MsgBox objOwner.Name
MsgBox NS.CurrentUser
Set newTaskFolder = NS.GetSharedDefaultFolder(objOwner, olFolderTasks)
Set colItems = newTaskFolder.Items
strFilter = "[Mileage] = " & Me.Case_Number + 0.21
MsgBox strFilter
Set colTasks = colItems.Restrict(strFilter)
For Each objTask In colTasks
objTask.Delete
Next
End If
End Sub