Group:  Microsoft Outlook ยป microsoft.public.outlook.program_vba
Thread: Deleting item in Draft folder

Deleting item in Draft folder
"John" <info[ at ]nospam.infovis.co.uk> 12/26/2008 10:20:37 AM
Hi

I am deleting folder as below;

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

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

Thanks

Regards


Re: Deleting item in Draft folder
"Michael Bauer [MVP - Outlook]" <mb[ at ]mvps.org> 12/27/2008 2:23:31 PM


No need to post twice. Some of us just enjoyed the Christmas days.

--
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 10:20:37 -0000 schrieb John:

[Quoted Text]
> Hi
>
> I am deleting folder as below;
>
> For I = oItems.Count - 1 To 0 Step -1
> oItems(I).delete()
> End If
>
> The problem is one element is always left in Draft folder from deletion.
> What am I doing wrong?
>
> Thanks
>
> Regards
Re: Deleting item in Draft folder
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 12/27/2008 9:42:28 PM
Items collection is 1, not 0 based:

For I = oItems.Count To 1 Step -1

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"John" <info[ at ]nospam.infovis.co.uk> wrote in message
news:OLLxYO0ZJHA.2620[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> Hi
>
> I am deleting folder as below;
>
> For I = oItems.Count - 1 To 0 Step -1
> oItems(I).delete()
> End If
>
> The problem is one element is always left in Draft folder from deletion.
> What am I doing wrong?
>
> Thanks
>
> Regards
>


Home | Search | Terms | Imprint
Newsgroups Reader