Deleting items from draft folder

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to delete items from draft folder based on value of a user property
xyz = "abc". The problems I have are;

1. How to access items in Draft folder?

2. How to select items based on condition user property xyz with value
"abc"?

3. How to delete all items?

Any help in achieving this would be appreciated.

Thanks

Regards
 
1. See the GetDefaultFolder function.

2. Loop backwards through the Items collection of the folder, and check each
item's UserProperties collection. Sample for a backward loop:
Dim i&
For i=Items.Count To 1 Step-1
....
Next

3. If you find the value in the UserProperties collection, call the item's
Delete method.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Sun, 21 Dec 2008 20:26:45 -0000 schrieb John:
 
Hi

I am using below code;

For I = oItems.Count - 1 To 0 Step -1
oItems(I).delete()
End If

The problem is one element is always left from deletion. What am I doing
wrong?

Thanks

Regards
 
John, please compare your code with my suggested loop. Do you see what's
wrong?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Fri, 26 Dec 2008 08:42:41 -0000 schrieb John:
 
onetalentsource


John said:
Hi

I need to delete items from draft folder based on value of a user property
xyz = "abc". The problems I have are;

1.

How to access items in Draft folder?
 
Back
Top