error while trying to move task

V

vonclausowitz

Hi,

I use some code the trap the deleting of an task item. But I get an
error:

"The items were copied instead of moved because the original items
could not be deleted. The item could not be deleted. It waas either
moved or already deleted, or access was denied."

the objDestinationFolder is defined earlier:

Dim objDestinationFolder As Outlook.MAPIFolder
Set objFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks)
Set objDestinationFolder = objFolder.Folders("Taken Oud")

Private Sub oTasks_ItemRemove()

Dim olOldFolder As String
olOldFolder = objDestinationFolder

If oTask.Complete = True Then
MsgBox "Do you want to move " & oTask & " to " & olOldFolder & " ?"
oTask.Move objDestinationFolder
End If

End Sub

Why is it saying that?

Marco
 
V

vonclausowitz

This is a follow up to my earlier ask Q.

I found that the next code is working without an error exept that if I
select multiple tasks to delete it doesn't work.

Private Sub oTasks_ItemRemove()

Dim myCopiedItem As Outlook.TaskItem
Dim olOldFolder As String
olOldFolder = objDestinationFolder

If oTask.Complete = True Then
MsgBox "Do you want to move " & oTask & " to " & olOldFolder & " ?"
Set myCopiedItem = oTask.Copy
myCopiedItem.Move objDestinationFolder
End If

End Sub

If I select two or more tasks they are moved to the old folder but they
are all named after the one that was highlighted.

Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top