PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming Quick way to delete all the items in a folder

Reply

Quick way to delete all the items in a folder

 
Thread Tools Rate Thread
Old 30-08-2004, 09:19 PM   #1
Tim
Guest
 
Posts: n/a
Default Quick way to delete all the items in a folder


I'm running into a performance issue trying to delete 100s of contact items
in a folder. I'm using the following code iternating backwards through the
items as recommended:

AllItems = oFolder.Items

' Loop through the items in the current folder. Looping through backwards in
case items are to be deleted, as this is the proper way to delete items in a
collection.

For i = ofolder.Items.Count To 1 Step -1

AllItems(i).Delete()

Next



However I was wondering if there is a faster way than the above method? I
looked for and couldn't find a way to delete all members of a collection.

Any ideas?

Tim


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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