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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

MAPIFolder.Delete() vs. RDOFolder.Delete()



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old November 15th 07, 05:06 PM posted to microsoft.public.outlook.program_addins
Mike
external usenet poster
 
Posts: 332
Default MAPIFolder.Delete() vs. RDOFolder.Delete()

I have a plugin which creates a folder that I only want to exist during the
time Outlook is running, so I've been experimenting with various ways to
delete this folder. Couple questions,

1) Using MAPIFolder.Delete() seems to work every time, but the folder ends
up in the Deleted Items folder...is there a way through the OOM to bypass
Deleted Items when deleting a folder?

2) Using Redemption's RDOFolder.Delete() is kind of hit or miss. What I've
noticed is that sometimes, right after creating the folder, I can delete it,
but most often when caling this method, I get a MAPI_E_EXTENDED_ERROR
(ErrorCode=-2147221223, Message="Error in IMAPIFolder:eleteFolder:
MAPI_E_EXTENDED_ERROR") . If I keep trying to delete this folder (i have a
test button calling the delete method), it will eventually work after about a
minute or so. Could this be the result of some kind of Exchange
synchronization holding onto the folder?

What is the best way to delete a folder? sample code follows for the
RDODelete call I'm using:

public bool DeleteArchiveSearchFolder(string sArchiveFolder)
{
if (!_IsValid() || sArchiveFolder == null)
return false;

// Have to find out if the thing is already here
RDOFolders fIPMFolders = m_DefaultMsgStore.IPMRootFolder.Folders;

foreach (RDOFolder f in fIPMFolders)
{
if (f.Name.Equals(sArchiveFolder,
StringComparison.CurrentCultureIgnoreCase))
{
f.Delete();
return true;
}
}

return false;
}



 




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
Outlook Macro to delete email from Sent Folder and Delete Folder Vishal Outlook and VBA 3 February 24th 07 04:52 AM
How do I delete an add-in Peter Day Outlook - Installation 0 February 14th 07 02:42 PM
Cant delete Mike Outlook - Using Contacts 1 July 26th 06 10:02 AM
How to Really Delete Sent items? [email protected] Outlook - General Queries 5 May 2nd 06 06:59 AM
can not delete ALROL Outlook Express 1 February 27th 06 03:36 PM


All times are GMT +1. The time now is 11:14 AM.


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.