A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Delete Shared Task



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 4th 07, 01:24 AM posted to microsoft.public.outlook.program_vba
Job[_2_]
external usenet poster
 
Posts: 14
Default Delete Shared Task

Trying to delete a shared task. Using this example:

Sub DeleteSharedTask()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim strFind As String
Dim objCalFolder As Outlook.MAPIFolder
Dim colCalendar As Outlook.Items
Dim objAppt As Outlook.TaskItem
Dim myRecipient As Outlook.recipient

Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
Set myRecipient = objNS.CreateRecipient("USER XYZ")
myRecipient.Resolve
If myRecipient.Resolved Then
Set objTaskFolder = objNS.GetSharedDefaultFolder(myRecipient,
olFolderTasks)
Set colTask = objTaskFolder.Items
strFind = "[Subject] = " & Chr(34) & "Test Delete" & Chr(34)
Set objTask = colTask.Find(strFind)
If Not objTask Is Nothing Then
objTask.Delete
End If
End If
Set objOL = Nothing
Set objNS = Nothing
Set objCalFolder = Nothing
Set colCalendar = Nothing
End Sub

Error on the objTask.Delete = The operation failed. An object could not be
found.

I can debug and display the item, change the item, look at all of the
itemproperties, but not delete. I have been granted ownership rights to the
user's shared tasks. Any suggestions?

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete a task request from inbox in outlook [email protected] Outlook - General Queries 0 March 8th 07 06:59 PM
How to delete a recurrent task with a blocked remove recurrence Dr Steve Outlook - Calandaring 0 August 10th 06 05:36 PM
How do I delete a Private appointment in a shared calendar? WendyN201 Outlook - Calandaring 1 June 13th 06 03:25 AM
Handling Task Item Delete Event AtulSureka Outlook - Using Forms 0 January 24th 06 10:25 AM
Delete / archive old entries in shared calendar in public folder Slam Outlook - Calandaring 1 January 18th 06 10:08 PM


All times are GMT +1. The time now is 03:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.