Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Applications / November 2005

Tip: Looking for answers? Try searching our database.

Deleted Item Continues to Show in Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike P. - 05 Nov 2005 02:29 GMT
I've written a tiny piece of combined CDO/Outlook code to permanently delete
a message.  Half the time, after the message is deleted, it still shows in
the folder.  But if I navigate to another folder, then navigate back to the
original folder, the message is gone.  Any suggestions about how to make it
disappear right away?  Thanks.

Here's the code:

Public Sub PermanentlyDeleteItem(objItem As Object)
'permanently deletes objItem from store
   Dim objCDOMsg As MAPI.Message
   Dim objCDOSession As MAPI.Session
   Dim strEntryID As String
   Dim strStoreID As String
   
   On Error Resume Next
   If Not objItem Is Nothing Then
       Set objCDOSession = New MAPI.Session
       objCDOSession.Logon "", "", False, False
       strEntryID = objItem.EntryID
       strStoreID = objItem.Parent.StoreID
       Set objCDOMsg = objCDOSession.GetMessage(strEntryID, strStoreID)
       If Not objCDOMsg Is Nothing Then
           objCDOMsg.Delete
       End If
   End If
   
   Set objItem = Nothing
   Set objCDOMsg = Nothing
   objCDOSession.Logoff
   Set objCDOSession = Nothing
   Set objCDO = Nothing
End Sub
Tom Rizzo [MSFT] - 06 Nov 2005 16:20 GMT
The message shows in Outlook?  Are you running cached mode since CDO will
delete it off the server and then it needs to sync to the Outlook client.

Tom

Signature

Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint?  Check out http://www.microsoft.com/MSPress/books/5517.asp

> I've written a tiny piece of combined CDO/Outlook code to permanently
> delete
[quoted text clipped - 32 lines]
>    Set objCDO = Nothing
> End Sub
Mike P. - 07 Nov 2005 08:15 GMT
No, we're not running Outlook in cached mode.  That's what's weird.

> The message shows in Outlook?  Are you running cached mode since CDO will
> delete it off the server and then it needs to sync to the Outlook client.
[quoted text clipped - 37 lines]
> >    Set objCDO = Nothing
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.